-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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](mtmv) Fix duplicate column name not check when create materialized view #40658
[fix](mtmv) Fix duplicate column name not check when create materialized view #40658
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
TPC-H: Total hot run time: 38377 ms
|
TPC-DS: Total hot run time: 197451 ms
|
ClickBench: Total hot run time: 31.71 s
|
PR approved by at least one committer and no changes requested. |
public void validateColumns(List<ColumnDefinition> columns) throws UserException { | ||
Set<String> colSets = Sets.newTreeSet(String.CASE_INSENSITIVE_ORDER); | ||
for (ColumnDefinition col : columns) { | ||
if (!colSets.add(col.getName())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we check invalid character in column name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah,already have the logic to check invalid caracter in column name, and move the check invalid caracter logic to method validateColumns
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 41634 ms
|
TPC-DS: Total hot run time: 194119 ms
|
ClickBench: Total hot run time: 31.91 s
|
297e378
to
30db4dd
Compare
run buildall |
TPC-H: Total hot run time: 41480 ms
|
TPC-DS: Total hot run time: 193722 ms
|
ClickBench: Total hot run time: 31.74 s
|
regression-test/suites/mtmv_p0/same_column_name_check/same_column_name_check.groovy
Outdated
Show resolved
Hide resolved
run buildall |
PR approved by at least one committer and no changes requested. |
TPC-H: Total hot run time: 41620 ms
|
TPC-DS: Total hot run time: 196034 ms
|
ClickBench: Total hot run time: 32.32 s
|
…zed view (#40658) ## Proposed changes This is brought by #26146 If create materialized view as following, Should fail, because has the duplicated column name `o_orderdatE` and `o_orderdate`. But now can create materialized view successfully. the pr fix this. ```sql CREATE MATERIALIZED VIEW mv_1 BUILD IMMEDIATE REFRESH AUTO ON MANUAL partition by(o_orderdate) DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS select o_orderdatE, o_shippriority, o_comment, o_orderdate, sum(o_totalprice) as sum_total, max(o_totalpricE) as max_total, min(o_totalprice) as min_total, count(*) as count_all, bitmap_union(to_bitmap(case when o_shippriority > 1 and o_orderkey IN (1, 3) then o_custkey else null end)) cnt_1, bitmap_union(to_bitmap(case when o_shippriority > 2 and o_orderkey IN (2) then o_custkey else null end)) as cnt_2 from (select * from orders) as t1 group by o_orderdatE, o_shippriority, o_comment, o_orderdate; ```
…zed view (apache#40658) This is brought by apache#26146 If create materialized view as following, Should fail, because has the duplicated column name `o_orderdatE` and `o_orderdate`. But now can create materialized view successfully. the pr fix this. ```sql CREATE MATERIALIZED VIEW mv_1 BUILD IMMEDIATE REFRESH AUTO ON MANUAL partition by(o_orderdate) DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS select o_orderdatE, o_shippriority, o_comment, o_orderdate, sum(o_totalprice) as sum_total, max(o_totalpricE) as max_total, min(o_totalprice) as min_total, count(*) as count_all, bitmap_union(to_bitmap(case when o_shippriority > 1 and o_orderkey IN (1, 3) then o_custkey else null end)) cnt_1, bitmap_union(to_bitmap(case when o_shippriority > 2 and o_orderkey IN (2) then o_custkey else null end)) as cnt_2 from (select * from orders) as t1 group by o_orderdatE, o_shippriority, o_comment, o_orderdate; ```
Proposed changes
This is brought by #26146
If create materialized view as following, Should fail, because has the duplicated column name
o_orderdatE
ando_orderdate
. But now can create materialized view successfully. the pr fix this.