wangshuo128 commented on code in PR #17853:
URL: https://github.com/apache/doris/pull/17853#discussion_r1138312800


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/mv/AbstractSelectMaterializedIndexRule.java:
##########
@@ -68,23 +79,17 @@ protected boolean containAllRequiredColumns(
             Set<Slot> requiredScanOutput) {
 
         OlapTable table = scan.getTable();
-        // Scan slot exprId -> slot name
-        Map<ExprId, String> exprIdToName = Stream.concat(
-                        scan.getOutput().stream(), 
scan.getNonUserVisibleOutput().stream())
-                .collect(Collectors.toMap(NamedExpression::getExprId, 
NamedExpression::getName));
 
-        // get required column names in metadata.
-        Set<String> requiredColumnNames = requiredScanOutput
-                .stream()
-                .map(slot -> exprIdToName.get(slot.getExprId()))
+        Set<String> requiredColumnNames = requiredScanOutput.stream()
+                .map(s -> normalizeName(s.getName()))
                 .collect(Collectors.toSet());
 
         Set<String> nameMap = table.getSchemaByIndexId(index.getId(), 
true).stream()

Review Comment:
   ```suggestion
           Set<String> mvColNames = table.getSchemaByIndexId(index.getId(), 
true).stream()
   ```



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to