-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](nereids) fix insert into values throw 'Invalid call to sql on unbound object' and 'Insert has filtered data in strict mode' exception #52802
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run buildall |
TPC-H: Total hot run time: 33478 ms |
TPC-DS: Total hot run time: 184614 ms |
ClickBench: Total hot run time: 29.23 s |
FE UT Coverage ReportIncrement line coverage |
b7e5cfb to
e06f84c
Compare
|
run buildall |
TPC-H: Total hot run time: 32956 ms |
TPC-DS: Total hot run time: 184986 ms |
ClickBench: Total hot run time: 29.33 s |
|
run buildall |
TPC-H: Total hot run time: 33362 ms |
TPC-DS: Total hot run time: 188030 ms |
ClickBench: Total hot run time: 30.06 s |
FE UT Coverage ReportIncrement line coverage |
|
run buildall |
TPC-H: Total hot run time: 33087 ms |
TPC-DS: Total hot run time: 185149 ms |
ClickBench: Total hot run time: 29.85 s |
FE UT Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
…nbound object' and 'Insert has filtered data in strict mode' exception (apache#52802) 1. fix `Invalid call to sql on unbound object` when use `interval`, introduced by apache#40202 ```sql CREATE TABLE `test_insert_cast_interval` ( `id` int NULL, `dt` date NULL ) ENGINE=OLAP DISTRIBUTED BY HASH(`id`) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" ); INSERT INTO test_insert_cast_interval values(1, date_floor('2020-02-02', interval 1 second)); (1105, 'errCode = 2, detailMessage = Invalid call to sql on unbound object') ``` 2. fix `Insert has filtered data in strict mode`, introduced by apache#49116 ```sql CREATE TABLE `test_insert_more_string` ( `r_regionkey` int NULL, `r_name` varchar(25) NULL, `r_comment` varchar(152) NULL ) ENGINE=OLAP DISTRIBUTED BY HASH(`r_regionkey`) BUCKETS 1 PROPERTIES ( "replication_allocation" = "tag.location.default: 1"); insert into test_insert_more_string values (3, "akljalkjbalkjsldkrjewokjfalksdjflaksjfdlaskjfalsdkfjalsdfjkasfdl", "aa"); (1105, 'errCode = 2, detailMessage = Insert has filtered data in strict mode') ``` (cherry picked from commit 2c01f69)
…nbound object' and 'Insert has filtered data in strict mode' exception (apache#52802) 1. fix `Invalid call to sql on unbound object` when use `interval`, introduced by apache#40202 ```sql CREATE TABLE `test_insert_cast_interval` ( `id` int NULL, `dt` date NULL ) ENGINE=OLAP DISTRIBUTED BY HASH(`id`) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" ); INSERT INTO test_insert_cast_interval values(1, date_floor('2020-02-02', interval 1 second)); (1105, 'errCode = 2, detailMessage = Invalid call to sql on unbound object') ``` 2. fix `Insert has filtered data in strict mode`, introduced by apache#49116 ```sql CREATE TABLE `test_insert_more_string` ( `r_regionkey` int NULL, `r_name` varchar(25) NULL, `r_comment` varchar(152) NULL ) ENGINE=OLAP DISTRIBUTED BY HASH(`r_regionkey`) BUCKETS 1 PROPERTIES ( "replication_allocation" = "tag.location.default: 1"); insert into test_insert_more_string values (3, "akljalkjbalkjsldkrjewokjfalksdjflaksjfdlaskjfalsdkfjalsdfjkasfdl", "aa"); (1105, 'errCode = 2, detailMessage = Insert has filtered data in strict mode') ``` (cherry picked from commit 2c01f69)
…r insert value truncate long string (#55325) for below sql: ```sql create table t(a int, b varchar(2)); insert into t values(1, 'abcde'); ``` for doris 2.0, the insert command will throw error 'Insert has filtered data in strict mode', because length of value 'abcde' is bigger than varchar(2). for mysql, pg, the above sql will also throw error for the same reason. for doris version >= 2.1.0, it will not throw error, and just truncate 'abcde' to 'ab'. what's more, for stream load, no matter 2.0, or 2.1, ..., doris will stream load fail. but considering 2.1 have released for 1.5+ year, we don't want to make a behaviour change for 2.1, so add a session variable enable_insert_value_auto_cast, when insert value with longer string value, then will have: - if enable_insert_value_auto_cast = true (default), the longer string will be truncate and insert succ; - if enable_insert_value_auto_cast = false, enable_insert_strict = true(default), will throw exception 'Insert has filtered data in strict mode'; - if enable_insert_value_auto_cast = false, enable_insert_strict = false, then the longer string will be filtered, other rows will insert succ. relate PR: #52802
…r insert value truncate long string (#55325) for below sql: ```sql create table t(a int, b varchar(2)); insert into t values(1, 'abcde'); ``` for doris 2.0, the insert command will throw error 'Insert has filtered data in strict mode', because length of value 'abcde' is bigger than varchar(2). for mysql, pg, the above sql will also throw error for the same reason. for doris version >= 2.1.0, it will not throw error, and just truncate 'abcde' to 'ab'. what's more, for stream load, no matter 2.0, or 2.1, ..., doris will stream load fail. but considering 2.1 have released for 1.5+ year, we don't want to make a behaviour change for 2.1, so add a session variable enable_insert_value_auto_cast, when insert value with longer string value, then will have: - if enable_insert_value_auto_cast = true (default), the longer string will be truncate and insert succ; - if enable_insert_value_auto_cast = false, enable_insert_strict = true(default), will throw exception 'Insert has filtered data in strict mode'; - if enable_insert_value_auto_cast = false, enable_insert_strict = false, then the longer string will be filtered, other rows will insert succ. relate PR: #52802
…r insert value truncate long string (apache#55325) for below sql: ```sql create table t(a int, b varchar(2)); insert into t values(1, 'abcde'); ``` for doris 2.0, the insert command will throw error 'Insert has filtered data in strict mode', because length of value 'abcde' is bigger than varchar(2). for mysql, pg, the above sql will also throw error for the same reason. for doris version >= 2.1.0, it will not throw error, and just truncate 'abcde' to 'ab'. what's more, for stream load, no matter 2.0, or 2.1, ..., doris will stream load fail. but considering 2.1 have released for 1.5+ year, we don't want to make a behaviour change for 2.1, so add a session variable enable_insert_value_auto_cast, when insert value with longer string value, then will have: - if enable_insert_value_auto_cast = true (default), the longer string will be truncate and insert succ; - if enable_insert_value_auto_cast = false, enable_insert_strict = true(default), will throw exception 'Insert has filtered data in strict mode'; - if enable_insert_value_auto_cast = false, enable_insert_strict = false, then the longer string will be filtered, other rows will insert succ. relate PR: apache#52802
What problem does this PR solve?
Invalid call to sql on unbound objectwhen useinterval, introduced by [enhancement](nereids) improve lots of values ininsert into valuesstatement #40202Insert has filtered data in strict mode, introduced by [feature](nereids)support stream load, routine load and broker load in nereids #49116Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)