public override void RetrieveResults(out ITableResults resTable, out GroupByResults groupByResults) { var tmpDict = new Dictionary <GroupDictKey, AggregateBucketResult[]>(); tmpDict.Add(new GroupDictKey(0, 0), this.finalResults); resTable = new TableResults(); groupByResults = new DictGroupDictKeyBucket(tmpDict, resTable); }
public override void Compute(out ITableResults resTable, out GroupByResults groupByResults) { if (next != null) { throw new Exception($"{this.GetType()}, there was an execution block after match block."); } this.matcher.Search(); this.resultProcessor.RetrieveResults(out resTable, out groupByResults); }
public override void RetrieveResults(out ITableResults resTable, out GroupByResults groupByResults) { groupByResults = null; if (this.sortJobs != null) { resTable = new TableResultsABTree((ABTree <int>) this.sortJobs[0].tree, this.sortJobs[0].resTable); } else { resTable = new MultiTableResultsRowProxyArray(this.mergeJob.GetTablesOfSortedJobs(), this.mergedResults); } }
public override void Compute(out ITableResults resTable, out GroupByResults groupByResults) { if (next != null) { throw new Exception($"{this.GetType()}, there was an execution block after match block."); } else { resTable = this.Search(); groupByResults = null; } }
public override void RetrieveResults(out ITableResults resTable, out GroupByResults groupByResults) { resTable = new TableResults(); if (this.groupJobs.Length > 1) { groupByResults = new ConDictGroupDictKeyFullBucket(this.globalGroups, resTable); } else { groupByResults = new DictGroupDictKeyBucket(this.groupJobs[0].groups, this.groupJobs[0].resTable); } }
public override void Compute(out ITableResults resTable, out GroupByResults groupByResults) { var aggs = this.aggregates.ToArray(); if (next != null) { this.next.Compute(out resTable, out groupByResults); this.next = null; if (resTable == null) { throw new ArgumentNullException($"{this.GetType()}, table results are set to null."); } // If there are no results, return empty storage. if (resTable.NumberOfMatchedElements == 0) { groupByResults = new GroupByResultsList(new Dictionary <GroupDictKey, int>(), null, resTable); } else { Grouper grouper; if (this.helper.IsSetSingleGroupGroupBy) { grouper = new SingleGroupGroupBy(aggs, null, this.helper); } else { // Use reference single thread solutions because the result table cannot be split equaly among threads. // This also means that the result table is quite small. if (resTable.NumberOfMatchedElements / helper.ThreadCount == 0) { grouper = Grouper.Factory(GrouperAlias.RefL, aggs, this.hashes, this.helper); } else { grouper = Grouper.Factory(aggs, this.hashes, this.helper); } } groupByResults = grouper.Group(resTable); } } else { throw new NullReferenceException($"{this.GetType()}, next is set to null."); } }
public override void RetrieveResults(out ITableResults resTable, out GroupByResults groupByResults) { groupByResults = null; if (this.executionHelper.ThreadCount == 1) { resTable = new TableResultsABTree((ABTree <int>) this.rangeBuckets[0].tree, this.rangeBuckets[0].resTable); } else { TableResultsABTree[] tmpResults = new TableResultsABTree[this.rangeBuckets.Length]; for (int i = 0; i < this.rangeBuckets.Length; i++) { tmpResults[i] = (new TableResultsABTree((ABTree <int>) this.rangeBuckets[i].tree, this.rangeBuckets[i].resTable)); } resTable = new MultiTableResultsABTree(tmpResults, this.firstKeyComparers[0].isAscending); } }
private void Print(ITableResults resTable, GroupByResults groupByResults) { var printer = Printer.Factory(this.helper.Printer, rowFormat, this.helper.Formater, this.helper.FileName); printer.PrintHeader(); if (!this.helper.IsSetGroupBy && !this.helper.IsSetSingleGroupGroupBy) { Print(resTable, printer); } else { Print(groupByResults, printer); } printer.Dispose(); }
private void Print(GroupByResults results, Printer printer) { if (results == null) { throw new ArgumentNullException($"{this.GetType()}, recieved group results as null."); } else { if (results.GetType() == typeof(GroupByResultsArray)) { var tmpResults = (GroupByResultsArray)results; foreach (var item in tmpResults) { printer.PrintRow(item); } } else if (results is GroupByResultsBucket) { var tmpResults = (GroupByResultsBucket)results; foreach (var item in tmpResults) { printer.PrintRow(item); } } else if (results is GroupByResultsList) { var tmpResults = (GroupByResultsList)results; foreach (var item in tmpResults) { printer.PrintRow(item); } } else if (results is GroupByResultsStreamedBucket) { var tmpResults = (GroupByResultsStreamedBucket)results; foreach (var item in tmpResults) { printer.PrintRow(item); } } else { throw new ArgumentException($"{this.GetType()}, received unknown group result holder. holder = {results.GetType()}."); } } }
public override void Compute(out ITableResults resTable, out GroupByResults groupByResults) { if (next != null) { this.next.Compute(out resTable, out groupByResults); this.next = null; if (allowPrint) { QueryEngine.PrintElapsedTime("Select start at"); this.Print(resTable, groupByResults); } } else { throw new NullReferenceException($"{this.GetType()}, next is set to null."); } }
public override void Compute(out ITableResults resTable, out GroupByResults groupByResults) { if (this.next != null) { this.next.Compute(out resTable, out groupByResults); this.next = null; if (resTable == null || groupByResults != null) { throw new ArgumentNullException($"{this.GetType()}, table results are set to null or groupByResults are not null."); } if (this.helper.IsStoringResult) { this.Sort(resTable); } } else { throw new NullReferenceException($"{this.GetType()}, next is set to null."); } }
public abstract void RetrieveResults(out ITableResults resTable, out GroupByResults groupByResults);
public abstract void Compute(out ITableResults resTable, out GroupByResults groupByResults);