somu-imply commented on code in PR #12493:
URL: https://github.com/apache/druid/pull/12493#discussion_r868285034


##########
processing/src/main/java/org/apache/druid/query/aggregation/last/StringLastVectorAggregator.java:
##########
@@ -123,13 +123,14 @@ public void aggregate(
   {
     long[] timeVector = timeSelector.getLongVector();
     Object[] objectsWhichMightBeStrings = valueSelector.getObjectVector();
+    // one time check on first element to judge if elements are serializable 
pairs or not
+    final int startRow = rows == null ? 0 : rows[0];
+    final boolean foldNeeded = 
StringFirstLastUtils.objectNeedsFoldCheck(objectsWhichMightBeStrings[startRow]);

Review Comment:
   After the change, we iterate over the array of objects to find the first 
non-null object and call it on that object only. That value is used at the rest 
of the places. This ensures similar behavior to the other case as above



-- 
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]

Reply via email to