Skip to content

Commit a0c4989

Browse files
committed
x
1 parent fa8f027 commit a0c4989

6 files changed

Lines changed: 170 additions & 177 deletions

File tree

src/query/sql/test-support/data/results/obfuscated/01_multi_join_avg_case_expression_optimized.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ Exchange(Merge)
1414
└── EvalScalar
1515
├── scalars: [a0c.a0d (#0) AS (#0), a0c.a0k (#7) AS (#7), a0c.a0m (#9) AS (#9), a2x.a5m (#144) AS (#144), if(eq(a5r.a1v (#154), '603020'), 1, 0) AS (#166), a1z.a2t (#70) AS (#171), a2x.a4m (#118) AS (#172), a5r.a5w (#156) AS (#173)]
1616
└── Join(Inner)
17-
├── build keys: [a0m (#149)]
18-
├── probe keys: [a0c.a0m (#9)]
17+
├── build keys: [a5r.a5t (#151)]
18+
├── probe keys: [a0c.a0l (#8)]
1919
├── other filters: []
2020
├── Exchange(Broadcast)
21-
│ └── EvalScalar
22-
│ ├── scalars: [CAST(a2x.a0m (#74) AS String NULL) AS (#149)]
23-
│ └── Scan
24-
│ ├── table: default.a2x (#2)
25-
│ ├── filters: [eq(substring(a2x.a4m (#118), 20, 1), '1')]
26-
│ ├── order by: []
27-
│ └── limit: NONE
21+
│ └── Scan
22+
│ ├── table: default.a5r (#3)
23+
│ ├── filters: [eq(substring(a5r.a5w (#156), 1, 1), '1')]
24+
│ ├── order by: []
25+
│ └── limit: NONE
2826
└── Join(Inner)
29-
├── build keys: [a5r.a5t (#151)]
30-
├── probe keys: [a0c.a0l (#8)]
27+
├── build keys: [a0m (#149)]
28+
├── probe keys: [a0c.a0m (#9)]
3129
├── other filters: []
3230
├── Exchange(Broadcast)
33-
│ └── Scan
34-
│ ├── table: default.a5r (#3)
35-
│ ├── filters: [eq(substring(a5r.a5w (#156), 1, 1), '1')]
36-
│ ├── order by: []
37-
│ └── limit: NONE
31+
│ └── EvalScalar
32+
│ ├── scalars: [CAST(a2x.a0m (#74) AS String NULL) AS (#149)]
33+
│ └── Scan
34+
│ ├── table: default.a2x (#2)
35+
│ ├── filters: [eq(substring(a2x.a4m (#118), 20, 1), '1')]
36+
│ ├── order by: []
37+
│ └── limit: NONE
3838
└── Join(Inner)
3939
├── build keys: [a1z.a0k (#48), a1z.a0n (#50)]
4040
├── probe keys: [a0c.a0k (#7), a0c.a0n (#10)]

src/query/sql/test-support/data/results/obfuscated/01_multi_join_avg_case_expression_physical.txt

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,77 +4,77 @@ Exchange
44
└── EvalScalar
55
├── output columns: [sell_mnt = 0 (#170)]
66
├── expressions: [t.sell_mnt (#169) = 0]
7-
├── estimated rows: 729765643534.22
7+
├── estimated rows: 58807078.72
88
└── EvalScalar
99
├── output columns: [sell_mnt (#169)]
1010
├── expressions: [sum(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#167) / CAST(if(CAST(count(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#168) = 0 AS Boolean NULL), 1, count(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#168)) AS UInt64 NULL) + 3]
11-
├── estimated rows: 729765643534.22
11+
├── estimated rows: 58807078.72
1212
└── AggregateFinal
1313
├── output columns: [sum(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#167), count(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#168), a.a0d (#0), a.a0k (#7), a.a0m (#9), c.a5m (#144)]
1414
├── group by: [a0d, a0k, a0m, a5m]
1515
├── aggregate functions: [sum(sum_arg_0), count()]
16-
├── estimated rows: 729765643534.22
16+
├── estimated rows: 58807078.72
1717
└── Exchange
1818
├── output columns: [sum(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#167), count(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#168), a.a0d (#0), a.a0k (#7), a.a0m (#9), c.a5m (#144)]
1919
├── exchange type: Hash(0, 1, 2, 3)
2020
└── AggregatePartial
2121
├── group by: [a0d, a0k, a0m, a5m]
2222
├── aggregate functions: [sum(sum_arg_0), count()]
23-
├── estimated rows: 729765643534.22
23+
├── estimated rows: 58807078.72
2424
└── EvalScalar
2525
├── output columns: [a.a0d (#0), a.a0k (#7), a.a0m (#9), c.a5m (#144), sum_arg_0 (#166)]
2626
├── expressions: [if(d.a1v (#154) = '603020', 1, 0)]
27-
├── estimated rows: 3769669953985.67
27+
├── estimated rows: 58807078.72
2828
└── HashJoin
29-
├── output columns: [a.a0d (#0), a.a0k (#7), a.a0m (#9), d.a1v (#154), c.a5m (#144)]
29+
├── output columns: [a.a0d (#0), a.a0k (#7), a.a0m (#9), c.a5m (#144), d.a1v (#154)]
3030
├── join type: INNER
31-
├── build keys: [c.a0m (#149)]
32-
├── probe keys: [a.a0m (#9)]
31+
├── build keys: [d.a5t (#151)]
32+
├── probe keys: [a.a0l (#8)]
3333
├── keys is null equal: [false]
3434
├── filters: []
3535
├── build join filters:
36-
│ └── filter id:3, build key:c.a0m (#149), probe targets:[a.a0m (#9)@scan0], filter type:bloom,inlist,min_max
37-
├── estimated rows: 3769669953985.67
36+
│ └── filter id:3, build key:d.a5t (#151), probe targets:[a.a0l (#8)@scan0], filter type:bloom,inlist,min_max
37+
├── estimated rows: 58807078.72
3838
├── Exchange(Build)
39-
│ ├── output columns: [c.a5m (#144), a0m (#149)]
39+
│ ├── output columns: [d.a5t (#151), d.a1v (#154)]
4040
│ ├── exchange type: Broadcast
41-
│ └── EvalScalar
42-
│ ├── output columns: [c.a5m (#144), a0m (#149)]
43-
│ ├── expressions: [CAST(c.a0m (#74) AS String NULL)]
44-
│ ├── estimated rows: 63773.60
45-
│ └── TableScan
46-
│ ├── table: default.default.a2x
47-
│ ├── scan id: 2
48-
│ ├── output columns: [a0m (#74), a5m (#144)]
49-
│ ├── read rows: 0
50-
│ ├── read size: 0
51-
│ ├── partitions total: 0
52-
│ ├── partitions scanned: 0
53-
│ ├── push downs: [filters: [is_true(substr(a2x.a4m (#118), 20, 1) = '1')], limit: NONE]
54-
│ └── estimated rows: 63773.60
41+
│ └── TableScan
42+
│ ├── table: default.default.a5r
43+
│ ├── scan id: 3
44+
│ ├── output columns: [a5t (#151), a1v (#154)]
45+
│ ├── read rows: 0
46+
│ ├── read size: 0
47+
│ ├── partitions total: 0
48+
│ ├── partitions scanned: 0
49+
│ ├── push downs: [filters: [is_true(substr(a5r.a5w (#156), 1, 1) = '1')], limit: NONE]
50+
│ └── estimated rows: 806.60
5551
└── HashJoin(Probe)
56-
├── output columns: [a.a0d (#0), a.a0k (#7), a.a0m (#9), d.a1v (#154)]
52+
├── output columns: [a.a0d (#0), a.a0k (#7), a.a0l (#8), a.a0m (#9), c.a5m (#144)]
5753
├── join type: INNER
58-
├── build keys: [d.a5t (#151)]
59-
├── probe keys: [a.a0l (#8)]
54+
├── build keys: [c.a0m (#149)]
55+
├── probe keys: [a.a0m (#9)]
6056
├── keys is null equal: [false]
6157
├── filters: []
6258
├── build join filters:
63-
│ └── filter id:2, build key:d.a5t (#151), probe targets:[a.a0l (#8)@scan0], filter type:bloom,inlist,min_max
64-
├── estimated rows: 59110195.35
59+
│ └── filter id:2, build key:c.a0m (#149), probe targets:[a.a0m (#9)@scan0], filter type:bloom,inlist,min_max
60+
├── estimated rows: 58716607.09
6561
├── Exchange(Build)
66-
│ ├── output columns: [d.a5t (#151), d.a1v (#154)]
62+
│ ├── output columns: [c.a5m (#144), a0m (#149)]
6763
│ ├── exchange type: Broadcast
68-
│ └── TableScan
69-
│ ├── table: default.default.a5r
70-
│ ├── scan id: 3
71-
│ ├── output columns: [a5t (#151), a1v (#154)]
72-
│ ├── read rows: 0
73-
│ ├── read size: 0
74-
│ ├── partitions total: 0
75-
│ ├── partitions scanned: 0
76-
│ ├── push downs: [filters: [is_true(substr(a5r.a5w (#156), 1, 1) = '1')], limit: NONE]
77-
│ └── estimated rows: 806.60
64+
│ └── EvalScalar
65+
│ ├── output columns: [c.a5m (#144), a0m (#149)]
66+
│ ├── expressions: [CAST(c.a0m (#74) AS String NULL)]
67+
│ ├── estimated rows: 63773.60
68+
│ └── TableScan
69+
│ ├── table: default.default.a2x
70+
│ ├── scan id: 2
71+
│ ├── output columns: [a0m (#74), a5m (#144)]
72+
│ ├── read rows: 0
73+
│ ├── read size: 0
74+
│ ├── partitions total: 0
75+
│ ├── partitions scanned: 0
76+
│ ├── push downs: [filters: [is_true(substr(a2x.a4m (#118), 20, 1) = '1')], limit: NONE]
77+
│ └── estimated rows: 63773.60
7878
└── HashJoin(Probe)
7979
├── output columns: [a.a0d (#0), a.a0k (#7), a.a0l (#8), a.a0m (#9)]
8080
├── join type: INNER

src/query/sql/test-support/data/results/obfuscated/01_multi_join_sum_case_expression_optimized.txt

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,36 @@ Exchange(Merge)
33
├── scalars: [a0c.a0d (#0) AS (#0), a0c.a0k (#7) AS (#7), a0c.a0m (#9) AS (#9), a2x.a5m (#144) AS (#144), sum(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#167) AS (#167), eq(sum(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) (#167), 0) AS (#168)]
44
└── Aggregate(Final)
55
├── group items: [a0c.a0d (#0) AS (#0), a0c.a0k (#7) AS (#7), a0c.a0m (#9) AS (#9), a2x.a5m (#144) AS (#144)]
6-
├── aggregate functions: [sum(sum(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) * _eager_count (#180)) AS (#167)]
6+
├── aggregate functions: [sum(sum_arg_0 (#166)) AS (#167)]
77
└── Aggregate(Partial)
88
├── group items: [a0c.a0d (#0) AS (#0), a0c.a0k (#7) AS (#7), a0c.a0m (#9) AS (#9), a2x.a5m (#144) AS (#144)]
9-
├── aggregate functions: [sum(sum(CASE WHEN d.a1v = '603020' THEN 1 ELSE 0 END) * _eager_count (#180)) AS (#167)]
9+
├── aggregate functions: [sum(sum_arg_0 (#166)) AS (#167)]
1010
└── Exchange(Hash)
1111
├── Exchange(Hash): keys: [a0c.a0d (#0)]
1212
└── EvalScalar
13-
├── scalars: [multiply(if(eq(a5r.a1v (#154), '603020'), 1, 0), CAST(count(*) (#179) AS UInt64)) AS (#180)]
13+
├── scalars: [a0c.a0d (#0) AS (#0), a0c.a0k (#7) AS (#7), a0c.a0m (#9) AS (#9), a2x.a5m (#144) AS (#144), if(eq(a5r.a1v (#154), '603020'), 1, 0) AS (#166), a1z.a2t (#70) AS (#169), a2x.a4m (#118) AS (#170), a5r.a5w (#156) AS (#171)]
1414
└── Join(Inner)
15-
├── build keys: [a0m (#149)]
16-
├── probe keys: [a0c.a0m (#9)]
15+
├── build keys: [a5r.a5t (#151)]
16+
├── probe keys: [a0c.a0l (#8)]
1717
├── other filters: []
1818
├── Exchange(Broadcast)
19-
│ └── Aggregate(Final)
20-
│ ├── group items: [a2x.a5m (#144) AS (#144), a0m (#149) AS (#149)]
21-
│ ├── aggregate functions: [count() AS (#179)]
22-
│ └── Aggregate(Partial)
23-
│ ├── group items: [a2x.a5m (#144) AS (#144), a0m (#149) AS (#149)]
24-
│ ├── aggregate functions: [count() AS (#179)]
25-
│ └── Exchange(Hash)
26-
│ ├── Exchange(Hash): keys: [a2x.a5m (#144)]
27-
│ └── EvalScalar
28-
│ ├── scalars: [CAST(a2x.a0m (#74) AS String NULL) AS (#149)]
29-
│ └── Scan
30-
│ ├── table: default.a2x (#2)
31-
│ ├── filters: [eq(substring(a2x.a4m (#118), 20, 1), '1')]
32-
│ ├── order by: []
33-
│ └── limit: NONE
19+
│ └── Scan
20+
│ ├── table: default.a5r (#3)
21+
│ ├── filters: [eq(substring(a5r.a5w (#156), 1, 1), '1')]
22+
│ ├── order by: []
23+
│ └── limit: NONE
3424
└── Join(Inner)
35-
├── build keys: [a5r.a5t (#151)]
36-
├── probe keys: [a0c.a0l (#8)]
25+
├── build keys: [a0m (#149)]
26+
├── probe keys: [a0c.a0m (#9)]
3727
├── other filters: []
3828
├── Exchange(Broadcast)
39-
│ └── Scan
40-
│ ├── table: default.a5r (#3)
41-
│ ├── filters: [eq(substring(a5r.a5w (#156), 1, 1), '1')]
42-
│ ├── order by: []
43-
│ └── limit: NONE
29+
│ └── EvalScalar
30+
│ ├── scalars: [CAST(a2x.a0m (#74) AS String NULL) AS (#149)]
31+
│ └── Scan
32+
│ ├── table: default.a2x (#2)
33+
│ ├── filters: [eq(substring(a2x.a4m (#118), 20, 1), '1')]
34+
│ ├── order by: []
35+
│ └── limit: NONE
4436
└── Join(Inner)
4537
├── build keys: [a1z.a0k (#48), a1z.a0n (#50)]
4638
├── probe keys: [a0c.a0k (#7), a0c.a0n (#10)]

0 commit comments

Comments
 (0)