pranavbhole commented on code in PR #15434:
URL: https://github.com/apache/druid/pull/15434#discussion_r1408714128
##########
processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyVectorAggregator.java:
##########
@@ -78,7 +84,22 @@ public void aggregate(ByteBuffer buf, int position, int
startRow, int endRow)
if (startRow < rows.length) {
IndexedInts row = rows[startRow];
@Nullable
- String foundValue = row.size() == 0 ? null :
multiValueSelector.lookupName(row.get(0));
+ String foundValue;
+ if (row.size() == 0) {
+ foundValue = null;
+ } else if (aggregateMultipleValues) {
+ if (row.size() > 1) {
+ List<String> arrayList = new ArrayList<>();
+ row.forEach(rowIndex -> {
+ arrayList.add(multiValueSelector.lookupName(rowIndex));
+ });
+ foundValue =
DimensionHandlerUtils.convertObjectToString(arrayList);
+ } else {
+ foundValue = multiValueSelector.lookupName(row.get(0));
Review Comment:
DimensionHandlerUtils.convertObjectToString handles null value and here
foundValue null is also handled.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]