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

[multistage][bugfix] fix literal query return multiple duplicate results #12240

Merged
merged 1 commit into from
Jan 8, 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
@@ -1,6 +1,15 @@
{
"literal_evaluation_tests": {
"queries": [
{
"description": "Select without from",
"sql": "EXPLAIN PLAN FOR SELECT 1",
"output": [
"Execution Plan",
"\nLogicalValues(tuples=[[{ 1 }]])",
"\n"
]
},
{
"description": "Select arithmetic expression",
"sql": "EXPLAIN PLAN FOR SELECT 5*6,5+6 FROM d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public LiteralValueOperator(OpChainExecutionContext context, DataSchema dataSche
super(context);
_dataSchema = dataSchema;
_rexLiteralBlock = constructBlock(rexLiteralRows);
_isLiteralBlockReturned = false;
// only return a single literal block when it is the 1st virtual server. otherwise, result will be duplicated.
_isLiteralBlockReturned = context.getId().getVirtualServerId() != 0;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{
"description": "basic test case example",
"sql": "SELECT * FROM {tbl}"
},
{
"description": "basic test with literal",
"sql": "SELECT 1 AS int, CAST(2 AS DOUBLE) AS double"
}
]
},
Expand Down
Loading