-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](nereids) Fix the int type coercion to big int wrongly when handle user set var #52689
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](nereids) Fix the int type coercion to big int wrongly when handle user set var #52689
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
2 similar comments
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 34183 ms |
TPC-DS: Total hot run time: 185261 ms |
ClickBench: Total hot run time: 30.32 s |
FE UT Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
e4dff17 to
412a14f
Compare
|
run buildall |
TPC-H: Total hot run time: 34557 ms |
TPC-DS: Total hot run time: 189149 ms |
ClickBench: Total hot run time: 29.77 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
2 similar comments
FE Regression Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
…le user set var (apache#52689) the value in the IntLiteral should be int, but now is long in old planner literalExpr so need to type coercion to generate right new planner int Literal such as the example as following: ```sql CREATE TABLE IF NOT EXISTS orders ( o_orderkey INTEGER NOT NULL, o_custkey INTEGER NOT NULL, o_orderstatus CHAR(1) NOT NULL, o_totalprice DECIMALV3(15,2) NOT NULL, o_orderdate DATE NOT NULL, o_orderpriority CHAR(15) NOT NULL, o_clerk CHAR(15) NOT NULL, o_shippriority INTEGER NOT NULL, O_COMMENT VARCHAR(79) NOT NULL ) DUPLICATE KEY(o_orderkey, o_custkey) DISTRIBUTED BY HASH(o_orderkey) BUCKETS 3 PROPERTIES ( "replication_num" = "1" ); insert into orders values (1, 1, 'o', 9.5, '2023-12-08', 'a', 'b', 1, 'yy'), (1, 1, 'o', 10.5, '2023-12-08', 'a', 'b', 1, 'yy'), (5, 2, 'o', 1.2, '2023-12-12', 'c','d',2, 'mi'); ``` if ` set @ship_no = 1;` and run query as following, should not add cast(o_shippriority as bigint) but now add cast(o_shippriority as bigint) worngly, this would cause tablet prune fail ,the pr fix this ```sql explain select * from orders where o_shippriority = @ship_no; ```
…le user set var (apache#52689) the value in the IntLiteral should be int, but now is long in old planner literalExpr so need to type coercion to generate right new planner int Literal such as the example as following: ```sql CREATE TABLE IF NOT EXISTS orders ( o_orderkey INTEGER NOT NULL, o_custkey INTEGER NOT NULL, o_orderstatus CHAR(1) NOT NULL, o_totalprice DECIMALV3(15,2) NOT NULL, o_orderdate DATE NOT NULL, o_orderpriority CHAR(15) NOT NULL, o_clerk CHAR(15) NOT NULL, o_shippriority INTEGER NOT NULL, O_COMMENT VARCHAR(79) NOT NULL ) DUPLICATE KEY(o_orderkey, o_custkey) DISTRIBUTED BY HASH(o_orderkey) BUCKETS 3 PROPERTIES ( "replication_num" = "1" ); insert into orders values (1, 1, 'o', 9.5, '2023-12-08', 'a', 'b', 1, 'yy'), (1, 1, 'o', 10.5, '2023-12-08', 'a', 'b', 1, 'yy'), (5, 2, 'o', 1.2, '2023-12-12', 'c','d',2, 'mi'); ``` if ` set @ship_no = 1;` and run query as following, should not add cast(o_shippriority as bigint) but now add cast(o_shippriority as bigint) worngly, this would cause tablet prune fail ,the pr fix this ```sql explain select * from orders where o_shippriority = @ship_no; ```
the value in the IntLiteral should be int, but now is long in old planner literalExpr
so need to type coercion to generate right new planner int Literal
such as the example as following:
if
set @ship_no = 1;and run query as following, should not add cast(o_shippriority as bigint) but now add cast(o_shippriority as bigint) worngly, this would cause tablet prune fail ,the pr fix thisWhat problem does this PR solve?
Issue Number: close #xxx
Related PR: #26655
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)