github-actions[bot] commented on code in PR #62478:
URL: https://github.com/apache/doris/pull/62478#discussion_r3083529706
##########
regression-test/suites/load_p0/insert/test_insert_strict_mode_and_filter_ratio.groovy:
##########
@@ -484,4 +484,326 @@ suite("test_insert_strict_mode_and_filter_ratio","p0") {
exception """Insert has filtered data in strict mode"""
}
qt_sql_mb_string_exceed_len_strict0 "select * from
test_insert_strict_mode_and_filter_ratio order by 1"
-}
\ No newline at end of file
+
+ // 7. insert into select, string exceed schema length
+ // 7.1 insert into select, string exceed schema length,
enable_insert_strict=false, insert_max_filter_ratio=0, load success
+ sql """
+ drop table if exists
test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ sql """
+ create table test_insert_select_strict_mode_and_filter_ratio_src(
+ id int,
+ name char(64)
+ ) properties ('replication_num' = '1');
+ """
+ sql "set enable_insert_strict=false"
+ sql "set enable_strict_cast=true"
+ sql "set insert_max_filter_ratio=0"
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_src values
+ (1, "a1"),
+ (20, "a20"),
+ (30, "a30"),
+ (59, "a59"),
+ (60, "a60"),
+ (70, "a70"),
+ (79, "a79"),
+ (81, "a1234567890"),
+ (91, "a9234567890"),
+ (100, "a10234567890");
+ """
+ qt_insert_select_string_exceed_len_non_strict0_src "select * from
test_insert_select_strict_mode_and_filter_ratio_src order by 1"
+ sql """
+ drop table if exists
test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ sql """
+ create table test_insert_select_strict_mode_and_filter_ratio_dst(
+ id int,
+ name char(10)
+ ) properties ('replication_num' = '1');
+ """
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select *
from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ qt_insert_select_string_exceed_len_non_strict0_dst "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 7.2 string exceed schema length, enable_insert_strict=true,
insert_max_filter_ratio=1, load fail
+ sql """
+ truncate table test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ sql "set enable_insert_strict=true"
+ sql "set enable_strict_cast=false"
+ sql "set insert_max_filter_ratio=1"
+ test {
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select
* from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ exception """Encountered unqualified data, stop processing"""
+ exception """url"""
+ }
+ qt_insert_select_string_exceed_len_strict1_dst "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 8. insert into select, number overflow
+ // 8.1 number overflow, enable_insert_strict=false,
insert_max_filter_ratio=0, success
+ sql """ DROP TABLE IF EXISTS
test_insert_select_strict_mode_and_filter_ratio_src """
+ sql """
+ CREATE TABLE test_insert_select_strict_mode_and_filter_ratio_src
+ (
+ k00 DECIMALV3(38,0)
+ )
+ PROPERTIES ("replication_num" = "1");
+ """
+ sql "set enable_insert_strict=false"
+ sql "set enable_strict_cast=true"
+ sql "set insert_max_filter_ratio=0"
+ sql """
+ INSERT INTO test_insert_select_strict_mode_and_filter_ratio_src VALUES
+ (1234567890),
+ (1234567891),
+ (1234567892),
+ (1234567893),
+ (1234567894),
+ (1234567895),
+ (1234567896),
+ (12345678971),
+ (12345678902),
+ (12345678903);
+ """
+ qt_insert_select_number_overflow_non_strict_src "select * from
test_insert_select_strict_mode_and_filter_ratio_src order by 1"
+
+ sql """ DROP TABLE IF EXISTS
test_insert_select_strict_mode_and_filter_ratio_dst """
+ sql """
+ CREATE TABLE test_insert_select_strict_mode_and_filter_ratio_dst
+ (
+ k00 DECIMALV3(10,0)
+ )
+ PROPERTIES ("replication_num" = "1");
+ """
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select *
from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ qt_insert_select_number_overflow_non_strict_dst "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 8.2 number overflow, enable_insert_strict=true,
insert_max_filter_ratio=1, fail
+ sql """
+ truncate table test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ sql "set enable_insert_strict=true"
+ sql "set enable_strict_cast=false"
+ sql "set insert_max_filter_ratio=1"
+ test {
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select
* from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ exception """Arithmetic overflow"""
+ }
+ qt_insert_select_number_overflow_strict0_dst "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 9. insert into select, not number to number
+ // 9.1 not number to number, enable_insert_strict=false,
insert_max_filter_ratio=0, success
+ sql """ DROP TABLE IF EXISTS
test_insert_select_strict_mode_and_filter_ratio_src """
+ sql """
+ CREATE TABLE test_insert_select_strict_mode_and_filter_ratio_src
+ (
+ k00 char(64)
+ )
+ PROPERTIES ("replication_num" = "1");
+ """
+ sql "set enable_insert_strict=false"
+ sql "set enable_strict_cast=true"
+ sql "set insert_max_filter_ratio=0"
+ sql """
+ INSERT INTO test_insert_select_strict_mode_and_filter_ratio_src VALUES
+ ("1234567abc"),
+ ("abc4567891"),
+ ("1234567xxx"),
+ (1234567893),
+ (1234567894),
+ (1234567895),
+ (1234567896),
+ (1234567897),
+ (1234567890),
+ (1234567890);
+ """
+ sql """
+ truncate table test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select *
from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ qt_insert_select_non_number_to_number_non_strict_dst "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 9.2 not number to number, enable_insert_strict=true,
insert_max_filter_ratio=1, fail
+ sql "set enable_insert_strict=true"
+ sql "set enable_strict_cast=false"
+ sql "set insert_max_filter_ratio=1"
+ sql """
+ truncate table test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ test {
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select
* from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ exception """INVALID_ARGUMENT"""
+ }
+ qt_insert_select_non_number_to_number_strict_dst "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 10. insert into select, null value to not null column
+ // 10.1 null value to not null column, enable_insert_strict=false,
insert_max_filter_ratio=0.2, fail
+ sql """ DROP TABLE IF EXISTS
test_insert_select_strict_mode_and_filter_ratio_src """
+ sql """
+ CREATE TABLE test_insert_select_strict_mode_and_filter_ratio_src
+ (
+ k00 DECIMALV3(10,0)
+ )
+ PROPERTIES ("replication_num" = "1");
+ """
+ sql "set enable_insert_strict=false"
+ sql "set enable_strict_cast=true"
+ sql "set insert_max_filter_ratio=0.2"
+ sql """
+ INSERT INTO test_insert_select_strict_mode_and_filter_ratio_src VALUES
+ (1234567890),
+ (1234567891),
+ (1234567892),
+ (1234567893),
+ (1234567894),
+ (1234567895),
+ (1234567896),
+ (12345678971),
+ (12345678902),
+ (12345678903);
+ """
+ qt_insert_select_null_into_not_null_non_strict_src "select * from
test_insert_select_strict_mode_and_filter_ratio_src order by 1"
+
+ sql """
+ DROP TABLE IF EXISTS
test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ sql """
+ CREATE TABLE test_insert_select_strict_mode_and_filter_ratio_dst
+ (
+ k00 DECIMALV3(10,0) NOT NULL
+ )
+ PROPERTIES ("replication_num" = "1");
+ """
+ test {
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select
* from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ exception """Insert has too many filtered data"""
+ exception """url"""
+ }
+ qt_insert_select_null_into_not_null_non_strict_dst0 "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 10.2 null value to not null column, enable_insert_strict=false,
insert_max_filter_ratio=0.3, success
+ sql """
+ truncate TABLE test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ sql "set enable_insert_strict=false"
+ sql "set enable_strict_cast=true"
+ sql "set insert_max_filter_ratio=0.3"
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select
* from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ qt_insert_select_null_into_not_null_non_strict_dst1 "select * from
test_insert_select_strict_mode_and_filter_ratio_dst order by 1"
+
+ // 10.3 null value to not null column, enable_insert_strict=true,
insert_max_filter_ratio=1, fail
+ sql """
+ truncate TABLE test_insert_select_strict_mode_and_filter_ratio_dst;
+ """
+ sql "set enable_insert_strict=true"
+ sql "set enable_strict_cast=false"
+ sql "set insert_max_filter_ratio=1"
+ test {
+ sql """
+ insert into test_insert_select_strict_mode_and_filter_ratio_dst select
* from test_insert_select_strict_mode_and_filter_ratio_src;
+ """
+ exception """Insert has too many filtered data"""
Review Comment:
This assertion looks inconsistent with the current `insert into select`
implementation. For this branch, the non-strict sibling just above already
shows the job completes and reports filtered rows, so the strict-mode failure
should come from `AbstractInsertExecutor.checkStrictModeAndFilterRatio()` in
FE. That code path raises `Insert has filtered data in strict mode`, not
`Insert has too many filtered data`, and it does not append a `url` check
either.
```suggestion
exception """Insert has filtered data in strict mode"""
```
--
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]