morrySnow commented on code in PR #58776:
URL: https://github.com/apache/doris/pull/58776#discussion_r2647703047
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathPlanCollector.java:
##########
@@ -56,6 +69,145 @@ public Map<Slot, List<CollectAccessPathResult>>
collect(Plan root, StatementCont
return scanSlotToAccessPaths;
}
+ @Override
+ public Void visitLogicalGenerate(LogicalGenerate<? extends Plan> generate,
StatementContext context) {
+ List<Function> generators = generate.getGenerators();
+ List<Slot> output = generate.getGeneratorOutput();
+
+ AccessPathExpressionCollector exprCollector
+ = new AccessPathExpressionCollector(context,
allSlotToAccessPaths, false);
+ for (int i = 0; i < output.size(); i++) {
+ Slot generatorOutput = output.get(i);
+ Function function = generators.get(i);
+ Collection<CollectAccessPathResult> accessPaths =
allSlotToAccessPaths.get(
+ generatorOutput.getExprId().asInt());
+ if (function instanceof Explode || function instanceof
ExplodeOuter) {
+ if (accessPaths.isEmpty()) {
+ // use the whole column
+ for (Expression child : function.children()) {
+ exprCollector.collect(child);
+ }
+ } else {
+ for (CollectAccessPathResult accessPath : accessPaths) {
+ List<String> path = accessPath.getPath();
+ if (function.arity() == 1) {
+ // $c$1.VALUES.b
Review Comment:
better to add some comment
--
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]