mayankshriv commented on a change in pull request #4535: Implement DISTINCT
clause
URL: https://github.com/apache/incubator-pinot/pull/4535#discussion_r315319936
##########
File path:
pinot-core/src/main/java/org/apache/pinot/core/operator/blocks/IntermediateResultsBlock.java
##########
@@ -231,41 +237,123 @@ private DataTable getSelectionResultDataTable()
SelectionOperatorUtils.getDataTableFromRows(_selectionResult,
_selectionDataSchema));
}
+
@Nonnull
private DataTable getAggregationResultDataTable()
throws Exception {
// Extract each aggregation column name and type from aggregation function
context.
- int numAggregationFunctions = _aggregationFunctionContexts.length;
- String[] columnNames = new String[numAggregationFunctions];
- DataSchema.ColumnDataType[] columnDataTypes = new
DataSchema.ColumnDataType[numAggregationFunctions];
- for (int i = 0; i < numAggregationFunctions; i++) {
- AggregationFunctionContext aggregationFunctionContext =
_aggregationFunctionContexts[i];
- columnNames[i] = aggregationFunctionContext.getAggregationColumnName();
- columnDataTypes[i] =
aggregationFunctionContext.getAggregationFunction().getIntermediateResultColumnType();
+ if (AggregationFunctionUtils.isDistinct(_aggregationFunctionContexts)) {
Review comment:
Yep, once we special case `distinct`, we have to do it at a lot of places,
as you already found out. Let's discuss how to resolve it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]