[feature](nereids) Support dereference expression#57532
[feature](nereids) Support dereference expression#57532924060929 merged 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
1 similar comment
|
run buildall |
ClickBench: Total hot run time: 29.12 s |
FE Regression Coverage ReportIncrement line coverage |
bd87a8d to
c277f2f
Compare
|
run buildall |
|
run buildall |
ClickBench: Total hot run time: 27.68 s |
FE Regression Coverage ReportIncrement line coverage |
2 similar comments
FE Regression Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/ExpressionAnalyzer.java
Outdated
Show resolved
Hide resolved
6d90687 to
7aea61e
Compare
|
run buildall |
TPC-H: Total hot run time: 34057 ms |
TPC-DS: Total hot run time: 181500 ms |
ClickBench: Total hot run time: 27.33 s |
FE Regression Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
FE Regression Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
Support dereference expression for map/struct/variant
```sql
MySQL root@127.0.0.1:rqg> select
-> named_struct('c', named_struct('c', 100)).c.c,
-> map('a', 10, 'b', 20).a,
-> map('a', 10, 'b', 20).b,
-> cast('{"a":{"b":300}}' as variant).a.b;
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
| named_struct('c', named_struct('c', 100)).c.c | map('a', 10, 'b', 20).a | map('a', 10, 'b', 20).b | cast('{"a":{"b":300}}' as variant).a.b |
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
| 100 | 10 | 20 | 300 |
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
```
<b>the slot name parts binding priority:</b>
1. try to bind catalog, if binding failed, jump to 2
2. try to bind database, if binding failed, jump to 3
3. try to bind table, if binding failed, jump to 4
4. try to bind column
for example, `a.a.a.a.a`
first try to bind: catalog=a, database=a, table=a, column=a, sub
fields=a
second try to bind: catalog=<current catalog>, database=a,
table=a, column=a, sub fields=a.a
third try to bind: catalog=<current catalog>, database=<current
database>, table=a, column=a, sub fields=a.a.a
4th try to bind: catalog=<current catalog>, database=<current
database>, table=<underscore table>, column=a, sub
fields=a.a.a.a
(cherry picked from commit ac92fd4)
Support dereference expression for map/struct/variant
```sql
MySQL root@127.0.0.1:rqg> select
-> named_struct('c', named_struct('c', 100)).c.c,
-> map('a', 10, 'b', 20).a,
-> map('a', 10, 'b', 20).b,
-> cast('{"a":{"b":300}}' as variant).a.b;
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
| named_struct('c', named_struct('c', 100)).c.c | map('a', 10, 'b', 20).a | map('a', 10, 'b', 20).b | cast('{"a":{"b":300}}' as variant).a.b |
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
| 100 | 10 | 20 | 300 |
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
```
<b>the slot name parts binding priority:</b>
1. try to bind catalog, if binding failed, jump to 2
2. try to bind database, if binding failed, jump to 3
3. try to bind table, if binding failed, jump to 4
4. try to bind column
for example, `a.a.a.a.a`
first try to bind: catalog=a, database=a, table=a, column=a, sub
fields=a
second try to bind: catalog=<current catalog>, database=a,
table=a, column=a, sub fields=a.a
third try to bind: catalog=<current catalog>, database=<current
database>, table=a, column=a, sub fields=a.a.a
4th try to bind: catalog=<current catalog>, database=<current
database>, table=<underscore table>, column=a, sub
fields=a.a.a.a
(cherry picked from commit ac92fd4)
fix can not prune dereference expression, introduced by #57532
Support dereference expression for map/struct/variant
```sql
MySQL root@127.0.0.1:rqg> select
-> named_struct('c', named_struct('c', 100)).c.c,
-> map('a', 10, 'b', 20).a,
-> map('a', 10, 'b', 20).b,
-> cast('{"a":{"b":300}}' as variant).a.b;
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
| named_struct('c', named_struct('c', 100)).c.c | map('a', 10, 'b', 20).a | map('a', 10, 'b', 20).b | cast('{"a":{"b":300}}' as variant).a.b |
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
| 100 | 10 | 20 | 300 |
+-----------------------------------------------+-------------------------+-------------------------+----------------------------------------+
```
<b>the slot name parts binding priority:</b>
1. try to bind catalog, if binding failed, jump to 2
2. try to bind database, if binding failed, jump to 3
3. try to bind table, if binding failed, jump to 4
4. try to bind column
for example, `a.a.a.a.a`
first try to bind: catalog=a, database=a, table=a, column=a, sub
fields=a
second try to bind: catalog=<current catalog>, database=a,
table=a, column=a, sub fields=a.a
third try to bind: catalog=<current catalog>, database=<current
database>, table=a, column=a, sub fields=a.a.a
4th try to bind: catalog=<current catalog>, database=<current
database>, table=<underscore table>, column=a, sub
fields=a.a.a.a
fix can not prune dereference expression, introduced by apache#57532
What problem does this PR solve?
Support dereference expression for map/struct/variant
the slot name parts binding priority:
for example,
a.a.a.a.afirst try to bind: catalog=a, database=a, table=a, column=a, sub fields=a
second try to bind: catalog=<current catalog>, database=a, table=a, column=a, sub fields=a.a
third try to bind: catalog=<current catalog>, database=<current database>, table=a, column=a, sub fields=a.a.a
4th try to bind: catalog=<current catalog>, database=<current database>, table=<underscore table>, column=a, sub fields=a.a.a.a
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)