Jackie-Jiang commented on a change in pull request #5765: URL: https://github.com/apache/incubator-pinot/pull/5765#discussion_r462055513
########## File path: pinot-core/src/main/java/org/apache/pinot/core/operator/docvalsets/ProjectionBlockValSet.java ########## @@ -32,32 +35,33 @@ public class ProjectionBlockValSet implements BlockValSet { private final DataBlockCache _dataBlockCache; private final String _column; - private final DataType _dataType; - private final boolean _singleValue; + private final DataSource _dataSource; /** * Constructor for the class. - * The dataBlockCache argument is initialized in {@link ProjectionOperator}, - * so that it can be reused across multiple calls to {@link ProjectionOperator#nextBlock()}. - * - * @param dataBlockCache data block cache - * @param column Projection column. + * The dataBlockCache is initialized in {@link ProjectionOperator} so that it can be reused across multiple calls to + * {@link ProjectionOperator#nextBlock()}. */ - public ProjectionBlockValSet(DataBlockCache dataBlockCache, String column, DataType dataType, boolean singleValue) { + public ProjectionBlockValSet(DataBlockCache dataBlockCache, String column, DataSource dataSource) { _dataBlockCache = dataBlockCache; _column = column; - _dataType = dataType; - _singleValue = singleValue; + _dataSource = dataSource; } @Override public DataType getValueType() { - return _dataType; + return _dataSource.getDataSourceMetadata().getDataType(); } @Override public boolean isSingleValue() { - return _singleValue; + return _dataSource.getDataSourceMetadata().isSingleValue(); + } + + @Nullable + @Override + public Dictionary getDictionary() { Review comment: For group-by, the dictionary is fetched from the `TransformFunction` ########## File path: pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/DistinctCountAggregationFunction.java ########## @@ -212,11 +259,57 @@ public IntOpenHashSet extractGroupByResult(GroupByResultHolder groupByResultHold IntOpenHashSet valueSet = groupByResultHolder.getResult(groupKey); if (valueSet == null) { return new IntOpenHashSet(); + } + + if (_dictionary != null) { + // For dictionary-encoded expression, convert dictionary ids to values + return convertToValueSet(valueSet); } else { return valueSet; } } + private IntOpenHashSet convertToValueSet(IntOpenHashSet dictIdSet) { Review comment: Added ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org