github-actions[bot] commented on code in PR #69344:
URL: https://github.com/apache/doris/pull/69344#discussion_r4489149834


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/ExprToThriftVisitor.java:
##########
@@ -651,26 +651,34 @@ static TSearchParam 
buildSearchThriftParam(SearchPredicate expr) {
             String fieldPath = binding.getFieldName();
             thriftBinding.setFieldName(fieldPath);
 
-            if (fieldPath.contains(".")) {
-                int firstDotPos = fieldPath.indexOf('.');
-                String parentField = fieldPath.substring(0, firstDotPos);
-                String subcolumnPath = fieldPath.substring(firstDotPos + 1);
-
-                thriftBinding.setIsVariantSubcolumn(true);
-                thriftBinding.setParentFieldName(parentField);
-                thriftBinding.setSubcolumnPath(subcolumnPath);
-            } else {
-                thriftBinding.setIsVariantSubcolumn(false);
-            }
-
+            // The logical name may be a projected alias. Read the physical 
Variant path
+            // from the final scan descriptor, e.g. label -> v.city after 
project pushdown.
+            thriftBinding.setIsVariantSubcolumn(false);
             thriftBinding.setSlotIndex(i);
-
             if (i < expr.getChildren().size() && expr.getChildren().get(i) 
instanceof SlotRef) {
                 SlotRef slotRef = (SlotRef) expr.getChildren().get(i);
-                int actualSlotId = slotRef.getSlotId().asInt();
-                thriftBinding.setSlotIndex(actualSlotId);
-            } else {
-                thriftBinding.setSlotIndex(i);
+                thriftBinding.setSlotIndex(slotRef.getSlotId().asInt());
+                SlotDescriptor descriptor = slotRef.getDesc();
+                List<String> subPath = descriptor.getSubColPath();
+                if (subPath != null && !subPath.isEmpty()) {
+                    thriftBinding.setIsVariantSubcolumn(true);
+                    
thriftBinding.setParentFieldName(descriptor.getColumn().getName());

Review Comment:
   [P2] Bind NESTED owners through the final physical field mapping
   
   In a build with NestedGroup search enabled and an indexed `v.items.msg`, 
this newly admitted plan fails execution:
   
   ```text
   Filter(search('NESTED(doc.items, msg:hello)'))
     Project(id, v AS doc)
       Scan(t)
   ```
   
   After pushdown the leaf is `v.items.msg`, so this emits 
`parent_field_name=v`, while `convertQsNodeToThrift` retains 
`nested_path=doc.items`. `bind_nested_column` in `vsearch.cpp` compares those 
roots (`v != doc`) and leaves `nested_column` unset. 
`VariantNestedSearchEvaluator::evaluate` then returns `Column 'doc' not bound 
to current read schema for nested query`, although the direct `NESTED(v.items, 
...)` form can execute. Resolve the NESTED owner and full array path through 
the final physical binding while retaining logical leaf keys, and add an 
executing alias regression. The previous missing-path report concerns ordinary 
leaf metadata; this failure is in NESTED owner resolution.



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