Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](Short Circuit) fix no project list in OlapScanNode #37121

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;

public class ShortCircuitQueryContext {
// Cached for better CPU performance, since serialize DescriptorTable and
Expand Down Expand Up @@ -66,8 +67,15 @@ public ShortCircuitQueryContext(Planner planner, Queriable analzyedQuery) throws
this.serializedQueryOptions = ByteString.copyFrom(
new TSerializer().serialize(options));
List<TExpr> exprs = new ArrayList<>();
for (Expr expr : planner.getFragments().get(1).getPlanRoot().getProjectList()) {
exprs.add(expr.treeToThrift());
OlapScanNode olapScanNode = (OlapScanNode) planner.getFragments().get(1).getPlanRoot();
if (olapScanNode.getProjectList() != null) {
// project on scan node
exprs.addAll(olapScanNode.getProjectList().stream()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should think about

result sink([#3, #2, #1])
+-- project([#1, #2, #3])
    +-- scan

Copy link
Member Author

@eldenmoon eldenmoon Jul 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will refactor some of the code before legacy planner removed

.map(Expr::treeToThrift).collect(Collectors.toList()));
} else {
// add output slots
exprs.addAll(planner.getFragments().get(0).getOutputExprs().stream()
.map(Expr::treeToThrift).collect(Collectors.toList()));
}
TExprList exprList = new TExprList(exprs);
serializedOutputExpr = ByteString.copyFrom(
Expand Down
Loading
Loading