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


##########
processing/src/main/java/org/apache/druid/segment/NestedDataColumnIndexer.java:
##########
@@ -142,29 +142,26 @@ public DimensionSelector makeDimensionSelector(
       IncrementalIndex.DimensionDesc desc
   )
   {
-    if (
-        fieldIndexers.size() == 1 &&
-        fieldIndexers.containsKey(NestedPathFinder.JSON_PATH_ROOT) &&
-        
fieldIndexers.get(NestedPathFinder.JSON_PATH_ROOT).getTypes().getSingleType() 
!= null
-    ) {
-      final ColumnValueSelector delegate = makeColumnValueSelector(currEntry, 
desc);
+    final int dimIndex = desc.getIndex();
+    final ColumnValueSelector<?> rootLiteralSelector = 
getRootLiteralValueSelector(currEntry, dimIndex);
+    if (rootLiteralSelector != null) {
       return new BaseSingleValueDimensionSelector()
       {
         @Nullable
         @Override
         protected String getValue()
         {
-          final Object o = delegate.getObject();
+          final Object o = rootLiteralSelector.getObject();
           if (o == null) {
             return null;
           }
-          return String.valueOf(o);
+          return o.toString();
         }
 
         @Override
         public void inspectRuntimeShape(RuntimeShapeInspector inspector)
         {
-          delegate.inspectRuntimeShape(inspector);
+

Review Comment:
   `inspectRuntimeShape` is used with the topN specialization stuff which 
doesn't do much if anything to incremental index queries afaik. i removed it 
from here because `rootLiteralSelector` method also does nothing so it seemed 
pointless
   
   



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