This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-4.2 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 79ee1b3c2b46e81222272a1909b0bba683e8f39f Author: Gabriel <[email protected]> AuthorDate: Sun Sep 20 17:49:50 2026 +0800 branch-4.1: [fix](regression) Align remote Doris VARIANT checks with current semantics #68165 (#68228) ### What problem does this PR solve? Related PR: #68165 Problem Summary: Backport the remote Doris VARIANT regression update from #68165 to branch-4.1. String casts now preserve strings, while this case expects structured JSON values and compares against obsolete golden output. Parse valid JSON fixtures explicitly, cast numeric predicates, and compare catalog reads with the internal source table. Two known predicate-result checks prevent empty nested-path results from passing both sides. The Parquet runtime-filter change from #68165 is not included because that suite is disabled on branch-4.1. ### Release note None ### Check List (For Author) - Test - [ ] Regression test - [ ] Unit Test - [x] Manual test Verified Groovy syntax compilation, branch-4.1 DSL/API availability, and `git diff --check`. The external Doris regression suite was not run locally; CI is requested. - Behavior changed: - [x] No production behavior changes. - [ ] Yes. - Does this need documentation? - [x] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label --- .../test_remote_doris_variant_select.out | 81 ---------------------- .../test_remote_doris_variant_select.groovy | 70 +++++++++++++------ 2 files changed, 49 insertions(+), 102 deletions(-) diff --git a/regression-test/data/external_table_p0/remote_doris/test_remote_doris_variant_select.out b/regression-test/data/external_table_p0/remote_doris/test_remote_doris_variant_select.out deleted file mode 100644 index 438583116fb..00000000000 --- a/regression-test/data/external_table_p0/remote_doris/test_remote_doris_variant_select.out +++ /dev/null @@ -1,81 +0,0 @@ --- This file is automatically generated. You should know what you did if you want to edit this --- !sql -- -1 {} -2 \N -3 true -4 -17 -5 123.12 -6 1.912 -7 "A quote" -8 [-1,12,false] -9 {"x":"abc","y":0,"z":10} -10 "2021-01-01" -11 {"a":"a","b":"0.1","c":{"c1":"c1","c2":"1"}} -12 {"a":"b","b":"0.1X","c":{"c1":"2","c2":"2"}} -13 "{\\"a\\":\\"ab\\"cde\\", \\"b\\":NULL, \\"d\\":{\\"d1\\":NULL, \\"d2\\":NULL}}" -14 "{\\"a\\":\\"ab{{c\\"de\\"}}\\"" -15 "{\\"a\\":\\"abc{{{de\\"" - --- !sql -- -11 {"a":"a","b":"0.1","c":{"c1":"c1","c2":"1"}} - --- !sql -- -12 {"a":"b","b":"0.1X","c":{"c1":"2","c2":"2"}} - --- !sql -- -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -a -b -\N -\N -\N - --- !sql -- -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -0.1 -0.1X -\N -\N -\N - --- !sql -- -0.1 - --- !sql -- -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -c1 -2 -\N -\N -\N - --- !sql -- -2 - diff --git a/regression-test/suites/external_table_p0/remote_doris/test_remote_doris_variant_select.groovy b/regression-test/suites/external_table_p0/remote_doris/test_remote_doris_variant_select.groovy index 72346c7168b..2a359b1a851 100644 --- a/regression-test/suites/external_table_p0/remote_doris/test_remote_doris_variant_select.groovy +++ b/regression-test/suites/external_table_p0/remote_doris/test_remote_doris_variant_select.groovy @@ -54,20 +54,21 @@ suite("test_remote_doris_variant_select", "p0,external,doris,external_docker,ext ); """ + // String-to-VARIANT casts preserve strings; parse JSON explicitly to exercise nested paths. sql """ INSERT INTO `${db_name}`.`test_remote_doris_variant_select_t` values - (1, 'null'), + (1, parse_to_variant('null')), (2, NULL), - (3, 'true'), - (4, '-17'), - (5, '123.12'), - (6, '1.912'), - (7, '"A quote"'), - (8, '[-1, 12, false]'), - (9, '{ "x": "abc", "y": false, "z": 10 }'), - (10, '"2021-01-01"'), - (11, '{"a":"a", "b":"0.1", "c":{"c1":"c1", "c2":"1"}}'), - (12, '{"a":"b", "b":"0.1X", "c":{"c1":"2", "c2":"2"}}'), + (3, parse_to_variant('true')), + (4, parse_to_variant('-17')), + (5, parse_to_variant('123.12')), + (6, parse_to_variant('1.912')), + (7, parse_to_variant('"A quote"')), + (8, parse_to_variant('[-1, 12, false]')), + (9, parse_to_variant('{ "x": "abc", "y": false, "z": 10 }')), + (10, parse_to_variant('"2021-01-01"')), + (11, parse_to_variant('{"a":"a", "b":"0.1", "c":{"c1":"c1", "c2":"1"}}')), + (12, parse_to_variant('{"a":"b", "b":"0.1X", "c":{"c1":"2", "c2":"2"}}')), (13, '{"a":"ab\\"cde", "b":NULL, "d":{"d1":NULL, "d2":NULL}}'), (14, '{"a":"ab{{c\\"de\\"}}"'), (15, '{"a":"abc{{{de"'); @@ -104,8 +105,21 @@ suite("test_remote_doris_variant_select", "p0,external,doris,external_docker,ext ); """ - qt_sql """ + // Keep nested-path coverage non-empty before comparing catalog reads with the source table. + check_sqls_result_equal """ + select id from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` + where cast(v['b'] as double) >= 0 order by id + """, "select 11" + check_sqls_result_equal """ + select id from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` + where cast(v['c']['c2'] as int) > 1 order by id + """, "select 12" + + // Compare with the source instead of golden text tied to an older VARIANT representation. + check_sqls_result_equal """ select * from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` order by id + """, """ + select * from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` order by id """ test { sql """ @@ -116,32 +130,46 @@ suite("test_remote_doris_variant_select", "p0,external,doris,external_docker,ext + "file format ARROW is not supported") } - qt_sql """ - select * from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` where v['b'] >= 0 order by id + check_sqls_result_equal """ + select * from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` where cast(v['b'] as double) >= 0 order by id + """, """ + select * from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` where cast(v['b'] as double) >= 0 order by id """ - qt_sql """ - select * from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` where v['c']['c2'] > 1 order by id + check_sqls_result_equal """ + select * from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` where cast(v['c']['c2'] as int) > 1 order by id + """, """ + select * from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` where cast(v['c']['c2'] as int) > 1 order by id """ - qt_sql """ + check_sqls_result_equal """ select v['a'] from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` order by id + """, """ + select v['a'] from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` order by id """ - qt_sql """ + check_sqls_result_equal """ select v['b'] from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` order by id + """, """ + select v['b'] from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` order by id """ - qt_sql """ + check_sqls_result_equal """ select sum(cast(v['b'] as double)) from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` + """, """ + select sum(cast(v['b'] as double)) from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` """ - qt_sql """ + check_sqls_result_equal """ select v['c']['c1'] from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` order by id + """, """ + select v['c']['c1'] from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` order by id """ - qt_sql """ + check_sqls_result_equal """ select sum(cast(v['c']['c1'] as double)) from `${catalog_name}`.`${db_name}`.`test_remote_doris_variant_select_t` + """, """ + select sum(cast(v['c']['c1'] as double)) from `internal`.`${db_name}`.`test_remote_doris_variant_select_t` """ sql """ DROP DATABASE IF EXISTS `${db_name}` """ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
