LakshSingla commented on code in PR #15559:
URL: https://github.com/apache/druid/pull/15559#discussion_r1494035884
##########
processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/column/ArrayDoubleGroupByColumnSelectorStrategy.java:
##########
@@ -53,15 +41,13 @@ protected int computeDictionaryId(ColumnValueSelector
selector)
if (object == null) {
return GROUP_BY_MISSING_VALUE;
} else if (object instanceof Double) {
- return addToIndexedDictionary(ImmutableList.of((Double) object));
+ return addToIndexedDictionary(new Object[]{object});
} else if (object instanceof List) {
- return addToIndexedDictionary((List<Double>) object);
+ return addToIndexedDictionary(((List) object).toArray());
} else if (object instanceof Double[]) {
- return addToIndexedDictionary(Arrays.asList((Double[]) object));
+ return addToIndexedDictionary(Arrays.stream((Double[])
object).toArray());
Review Comment:
Since there are ad-hoc checks elsewhere, I kept it for now just in case we
do encounter a rogue selector (possibly in some custom extension). If we do
shift to ArrayColumnValueSelectors, we can get rid of it safely. I have added a
comment about the redundancy of the branch though.
--
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]