Skip to content

Commit

Permalink
use alias columns explicitlity
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed Sep 14, 2023
1 parent 9364c06 commit da6c2cb
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
expected_outputs:
- batch_plan
- stream_plan
- name: use alias columns explicitlity
sql: |
create table t(x int , arr int[]);
select x, arr, a, ord from t cross join unnest(arr) WITH ORDINALITY as foo(a,ord);
expected_outputs:
- batch_plan
- stream_plan
- sql: |
create table t(x int , arr int[]);
select * from t cross join unnest(arr) WITH ORDINALITY as foo(a,ord,bar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,31 @@
└─StreamHashAgg { group_key: [t.arr], aggs: [count] }
└─StreamExchange { dist: HashShard(t.arr) }
└─StreamTableScan { table: t, columns: [t.arr, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) }
- name: use alias columns explicitlity
sql: |
create table t(x int , arr int[]);
select x, arr, a, ord from t cross join unnest(arr) WITH ORDINALITY as foo(a,ord);
batch_plan: |-
BatchExchange { order: [], dist: Single }
└─BatchProject { exprs: [t.x, t.arr, Unnest($0), (projected_row_id + 1:Int64) as $expr1] }
└─BatchHashJoin { type: Inner, predicate: t.arr IS NOT DISTINCT FROM t.arr, output: all }
├─BatchExchange { order: [], dist: HashShard(t.arr) }
│ └─BatchScan { table: t, columns: [t.x, t.arr], distribution: SomeShard }
└─BatchProjectSet { select_list: [$0, Unnest($0)] }
└─BatchHashAgg { group_key: [t.arr], aggs: [] }
└─BatchExchange { order: [], dist: HashShard(t.arr) }
└─BatchScan { table: t, columns: [t.arr], distribution: SomeShard }
stream_plan: |-
StreamMaterialize { columns: [x, arr, a, ord, t._row_id(hidden), t.arr(hidden), projected_row_id(hidden)], stream_key: [t._row_id, t.arr, projected_row_id, arr], pk_columns: [t._row_id, t.arr, projected_row_id, arr], pk_conflict: NoCheck }
└─StreamProject { exprs: [t.x, t.arr, Unnest($0), (projected_row_id + 1:Int64) as $expr1, t._row_id, t.arr, projected_row_id] }
└─StreamHashJoin { type: Inner, predicate: t.arr IS NOT DISTINCT FROM t.arr, output: [t.x, t.arr, projected_row_id, t.arr, Unnest($0), t._row_id] }
├─StreamExchange { dist: HashShard(t.arr) }
│ └─StreamTableScan { table: t, columns: [t.x, t.arr, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) }
└─StreamProjectSet { select_list: [$0, Unnest($0)] }
└─StreamProject { exprs: [t.arr] }
└─StreamHashAgg { group_key: [t.arr], aggs: [count] }
└─StreamExchange { dist: HashShard(t.arr) }
└─StreamTableScan { table: t, columns: [t.arr, t._row_id], pk: [t._row_id], dist: UpstreamHashShard(t._row_id) }
- sql: |
create table t(x int , arr int[]);
select * from t cross join unnest(arr) WITH ORDINALITY as foo(a,ord,bar);
Expand Down

0 comments on commit da6c2cb

Please sign in to comment.