pranavbhole commented on code in PR #15434:
URL: https://github.com/apache/druid/pull/15434#discussion_r1407000710
##########
processing/src/main/java/org/apache/druid/query/aggregation/any/StringAnyVectorAggregator.java:
##########
@@ -78,7 +84,23 @@ 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 -> {
+ String chopped =
StringUtils.fastLooseChop(multiValueSelector.lookupName(rowIndex),
maxStringBytes);
Review Comment:
I removed it. Applied to arrays initially to avoid partially chopped result
like `[first, seco`. applying chop at last leaves the result in weird open
ended array. I think it might be expected as user can change it with increasing
max bytes.
--
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]