diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java index 62238b4dfbadac..52894f033a2b5c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java @@ -540,6 +540,9 @@ public boolean hasCol() { } public String getColumnName() { + if (subColPath != null && !subColPath.isEmpty()) { + return col + "." + String.join(".", subColPath); + } return col; } diff --git a/regression-test/data/variant_p0/sql/rewrite_or_to_in.out b/regression-test/data/variant_p0/sql/rewrite_or_to_in.out new file mode 100644 index 00000000000000..81e664e6b10ad8 --- /dev/null +++ b/regression-test/data/variant_p0/sql/rewrite_or_to_in.out @@ -0,0 +1,12 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !rewrite_or_to_in -- +0 + +-- !rewrite_or_to_in_2 -- +DeleteEvent megan777/calculator 2021-01-02T16:37:26Z +DeleteEvent megan777/calculator 2021-01-02T16:37:26Z +DeleteEvent megan777/calculator 2021-01-02T16:37:27Z +PushEvent megan777/calculator 2021-01-02T16:39:09Z +CreateEvent megan777/calculator 2021-01-02T16:39:41Z +PullRequestEvent megan777/calculator 2021-01-02T16:39:41Z + diff --git a/regression-test/suites/variant_p0/sql/rewrite_or_to_in.sql b/regression-test/suites/variant_p0/sql/rewrite_or_to_in.sql new file mode 100644 index 00000000000000..e8fd6ac56052c0 --- /dev/null +++ b/regression-test/suites/variant_p0/sql/rewrite_or_to_in.sql @@ -0,0 +1,6 @@ +set rewrite_or_to_in_predicate_threshold = 2; +select + cast(v:type as string), cast(v:repo.name as string), cast(v:created_at as string) +from ghdata +where cast(v:type as string) = 'Delete' or cast(v:repo.name as string) = 'megan777/calculator' or cast(v:created_as as string) = '2021-01-02T16:37:26Z' +order by k limit 10; \ No newline at end of file