clintropolis commented on code in PR #13561:
URL: https://github.com/apache/druid/pull/13561#discussion_r1049145951


##########
processing/src/main/java/org/apache/druid/segment/nested/NestedFieldLiteralDictionaryEncodedColumn.java:
##########
@@ -509,6 +527,124 @@ public boolean isNull()
         };
       }
     }
+    if (singleType == null) {
+      return new ColumnValueSelector<Object>()
+      {
+
+        private PeekableIntIterator nullIterator = 
nullBitmap.peekableIterator();
+        private int nullMark = -1;
+        private int offsetMark = -1;
+
+        @Nullable
+        @Override
+        public Object getObject()
+        {
+          final int localId = column.get(offset.getOffset());
+          final int globalId = dictionary.get(localId);
+          if (globalId < globalDictionary.size()) {
+            return 
StringUtils.fromUtf8Nullable(globalDictionary.get(globalId));
+          } else if (globalId < globalDictionary.size() + 
globalLongDictionary.size()) {
+            return globalLongDictionary.get(globalId - adjustLongId);
+          } else {
+            return globalDoubleDictionary.get(globalId - adjustDoubleId);
+          }
+        }
+
+        @Override
+        public float getFloat()
+        {
+          final int localId = column.get(offset.getOffset());
+          final int globalId = dictionary.get(localId);
+          if (globalId == 0) {
+            // zero
+            assert NullHandling.replaceWithDefault();

Review Comment:
   not sure we need the assert, cargo cult from other selector impls. i assume 
it was originally added as a sanity check to make sure nothing is calling get 
methods in sql compatible mode if isNull returned true



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