diff --git a/rust/frontend/test_runner/tests/testdata/basic_query_1.yaml b/rust/frontend/test_runner/tests/testdata/basic_query_1.yaml index f507e0a7557f2..2fa02129451c0 100644 --- a/rust/frontend/test_runner/tests/testdata/basic_query_1.yaml +++ b/rust/frontend/test_runner/tests/testdata/basic_query_1.yaml @@ -8,10 +8,10 @@ select * from t; batch_plan: | BatchExchange { order: [], dist: Single } - BatchScan { table: t, columns: [_row_id#0, v1, v2] } + BatchScan { table: t, columns: [v1, v2] } stream_plan: | - StreamMaterialize { columns: [_row_id#0, v1, v2], pk_columns: [_row_id#0] } - StreamTableScan { table: t, columns: [_row_id#0, v1, v2], pk_indices: [0] } + StreamMaterialize { columns: [v1, v2, _row_id#0(hidden)], pk_columns: [_row_id#0] } + StreamTableScan { table: t, columns: [v1, v2, _row_id#0], pk_indices: [2] } - sql: | create table t (v1 bigint, v2 double precision); select t2.* from t; @@ -22,9 +22,9 @@ batch_plan: | BatchExchange { order: [], dist: Single } BatchFilter { predicate: (((((1:Int32 > 2:Int32) AND (1:Int32 = 1:Int32)) AND (3:Int32 < 1:Int32)) AND (4:Int32 <> 1:Int32)) OR (((1:Int32 = 1:Int32) AND (2:Int32 >= 1:Int32)) AND (1:Int32 <= 2:Int32))) } - BatchScan { table: t, columns: [_row_id#0] } + BatchScan { table: t, columns: [] } stream_plan: | - StreamMaterialize { columns: [_row_id#0], pk_columns: [_row_id#0] } + StreamMaterialize { columns: [_row_id#0(hidden)], pk_columns: [_row_id#0] } StreamFilter { predicate: (((((1:Int32 > 2:Int32) AND (1:Int32 = 1:Int32)) AND (3:Int32 < 1:Int32)) AND (4:Int32 <> 1:Int32)) OR (((1:Int32 = 1:Int32) AND (2:Int32 >= 1:Int32)) AND (1:Int32 <= 2:Int32))) } StreamTableScan { table: t, columns: [_row_id#0], pk_indices: [0] } - sql: | @@ -32,12 +32,12 @@ select * from t where v1<1; batch_plan: | BatchExchange { order: [], dist: Single } - BatchFilter { predicate: ($1 < 1:Int32) } - BatchScan { table: t, columns: [_row_id#0, v1] } + BatchFilter { predicate: ($0 < 1:Int32) } + BatchScan { table: t, columns: [v1] } stream_plan: | - StreamMaterialize { columns: [_row_id#0, v1], pk_columns: [_row_id#0] } - StreamFilter { predicate: ($1 < 1:Int32) } - StreamTableScan { table: t, columns: [_row_id#0, v1], pk_indices: [0] } + StreamMaterialize { columns: [v1, _row_id#0(hidden)], pk_columns: [_row_id#0] } + StreamFilter { predicate: ($0 < 1:Int32) } + StreamTableScan { table: t, columns: [v1, _row_id#0], pk_indices: [1] } - sql: | create table t (); select (((((false is not true) is true) is not false) is false) is not null) is null from t; diff --git a/rust/frontend/test_runner/tests/testdata/limit.yaml b/rust/frontend/test_runner/tests/testdata/limit.yaml index 7a1bb0c8b9427..49ad5924d7f97 100644 --- a/rust/frontend/test_runner/tests/testdata/limit.yaml +++ b/rust/frontend/test_runner/tests/testdata/limit.yaml @@ -4,14 +4,14 @@ logical_plan: | LogicalLimit { limit: 4, offset: 0 } LogicalProject { exprs: [$1], expr_alias: [v] } - LogicalScan { table: t, columns: [_row_id, v] } + LogicalScan { table: t, columns: [_row_id#0, v] } - sql: | create table t (v int not null); select * from t offset 4; logical_plan: | LogicalLimit { limit: 9223372036854775807, offset: 4 } LogicalProject { exprs: [$1], expr_alias: [v] } - LogicalScan { table: t, columns: [_row_id, v] } + LogicalScan { table: t, columns: [_row_id#0, v] } - sql: | create table t (v int not null); select * from ( select * from t limit 5 ) limit 4; @@ -20,4 +20,4 @@ LogicalProject { exprs: [$0], expr_alias: [v] } LogicalLimit { limit: 5, offset: 0 } LogicalProject { exprs: [$1], expr_alias: [v] } - LogicalScan { table: t, columns: [_row_id, v] } + LogicalScan { table: t, columns: [_row_id#0, v] } diff --git a/rust/frontend/test_runner/tests/testdata/order_by.yaml b/rust/frontend/test_runner/tests/testdata/order_by.yaml index b6c7d1086b1e0..b63ad3da5212b 100644 --- a/rust/frontend/test_runner/tests/testdata/order_by.yaml +++ b/rust/frontend/test_runner/tests/testdata/order_by.yaml @@ -2,9 +2,9 @@ create table t (v1 bigint, v2 double precision); select * from t order by v1 desc; batch_plan: | - BatchExchange { order: [$1 DESC], dist: Single } - BatchSort { order: [$1 DESC] } - BatchScan { table: t, columns: [_row_id#0, v1, v2] } + BatchExchange { order: [$0 DESC], dist: Single } + BatchSort { order: [$0 DESC] } + BatchScan { table: t, columns: [v1, v2] } - sql: | create table t (v1 bigint, v2 double precision); select t.* from t order by v1; diff --git a/rust/frontend/test_runner/tests/testdata/predicate_pushdown.yaml b/rust/frontend/test_runner/tests/testdata/predicate_pushdown.yaml index d28a27a734504..1a4d6e2cbb005 100644 --- a/rust/frontend/test_runner/tests/testdata/predicate_pushdown.yaml +++ b/rust/frontend/test_runner/tests/testdata/predicate_pushdown.yaml @@ -3,28 +3,28 @@ create table t2 (v1 int, v2 int, v3 int); select * from t1 join t2 on t1.v1=t2.v2 and t1.v1>1 where t2.v2>2; logical_plan: | - LogicalProject { exprs: [$0, $1, $2, $3, $4, $5, $6, $7], expr_alias: [_row_id#0, v1, v2, v3, _row_id#0, v1, v2, v3] } + LogicalProject { exprs: [$1, $2, $3, $5, $6, $7], expr_alias: [v1, v2, v3, v1, v2, v3] } LogicalFilter { predicate: ($6 > 2:Int32) } LogicalJoin { type: Inner, on: ($1 = $6) AND ($1 > 1:Int32) } LogicalScan { table: t1, columns: [_row_id#0, v1, v2, v3] } LogicalScan { table: t2, columns: [_row_id#0, v1, v2, v3] } optimized_logical_plan: | - LogicalJoin { type: Inner, on: ($1 = $6) } - LogicalFilter { predicate: ($1 > 1:Int32) } - LogicalScan { table: t1, columns: [_row_id#0, v1, v2, v3] } - LogicalFilter { predicate: ($2 > 2:Int32) } - LogicalScan { table: t2, columns: [_row_id#0, v1, v2, v3] } + LogicalJoin { type: Inner, on: ($0 = $4) } + LogicalFilter { predicate: ($0 > 1:Int32) } + LogicalScan { table: t1, columns: [v1, v2, v3] } + LogicalFilter { predicate: ($1 > 2:Int32) } + LogicalScan { table: t2, columns: [v1, v2, v3] } - sql: | create table t (v1 bigint, v2 double precision); select * from (select * from t) where v2 > 1; logical_plan: | - LogicalProject { exprs: [$0, $1, $2], expr_alias: [_row_id#0, v1, v2] } - LogicalFilter { predicate: ($2 > 1:Int32) } - LogicalProject { exprs: [$0, $1, $2], expr_alias: [_row_id#0, v1, v2] } + LogicalProject { exprs: [$0, $1], expr_alias: [v1, v2] } + LogicalFilter { predicate: ($1 > 1:Int32) } + LogicalProject { exprs: [$1, $2], expr_alias: [v1, v2] } LogicalScan { table: t, columns: [_row_id#0, v1, v2] } optimized_logical_plan: | - LogicalFilter { predicate: ($2 > 1:Int32) } - LogicalScan { table: t, columns: [_row_id#0, v1, v2] } + LogicalFilter { predicate: ($1 > 1:Int32) } + LogicalScan { table: t, columns: [v1, v2] } - sql: | create table t (v1 bigint, v2 double precision); select v1 from (select v2, v1 from t) where v2 > 1; diff --git a/rust/frontend/test_runner/tests/testdata/stream_proto.yaml b/rust/frontend/test_runner/tests/testdata/stream_proto.yaml index 38a0325daf70a..da56abb1ee041 100644 --- a/rust/frontend/test_runner/tests/testdata/stream_proto.yaml +++ b/rust/frontend/test_runner/tests/testdata/stream_proto.yaml @@ -14,10 +14,6 @@ tableRefId: tableId: 1 columnDescs: - - columnType: - typeName: INT64 - isNullable: true - name: "_row_id#0" - columnType: typeName: INT32 isNullable: true @@ -26,7 +22,7 @@ - columnType: typeName: INT64 isNullable: true - name: _row_id + name: "_row_id#0" pkIndices: - 1 chainNode: @@ -82,11 +78,6 @@ id: 4294967294 name: test columns: - - columnDesc: - columnType: - typeName: INT64 - isNullable: true - name: "_row_id#0" - columnDesc: columnType: typeName: INT32 @@ -97,7 +88,7 @@ typeName: INT64 isNullable: true columnId: 1 - name: _row_id + name: "_row_id#0" isHidden: true pkColumnIds: - 1 @@ -118,10 +109,6 @@ tableRefId: tableId: 1 columnDescs: - - columnType: - typeName: INT64 - isNullable: true - name: "_row_id#0" - columnType: typeName: INT32 isNullable: true @@ -130,7 +117,7 @@ - columnType: typeName: INT64 isNullable: true - name: _row_id + name: "_row_id#0" pkIndices: - 1 chainNode: @@ -165,11 +152,6 @@ id: 4294967294 name: test columns: - - columnDesc: - columnType: - typeName: INT64 - isNullable: true - name: "_row_id#0" - columnDesc: columnType: typeName: INT32 @@ -180,7 +162,7 @@ typeName: INT64 isNullable: true columnId: 1 - name: _row_id + name: "_row_id#0" isHidden: true pkColumnIds: - 1 diff --git a/rust/frontend/test_runner/tests/testdata/subquery.yaml b/rust/frontend/test_runner/tests/testdata/subquery.yaml index 352d6dc027911..351ff319f7d81 100644 --- a/rust/frontend/test_runner/tests/testdata/subquery.yaml +++ b/rust/frontend/test_runner/tests/testdata/subquery.yaml @@ -2,9 +2,9 @@ create table t (v1 bigint, v2 double precision); select v1 from (select * from t) where v2 > 1; logical_plan: | - LogicalProject { exprs: [$1], expr_alias: [v1] } - LogicalFilter { predicate: ($2 > 1:Int32) } - LogicalProject { exprs: [$0, $1, $2], expr_alias: [_row_id#0, v1, v2] } + LogicalProject { exprs: [$0], expr_alias: [v1] } + LogicalFilter { predicate: ($1 > 1:Int32) } + LogicalProject { exprs: [$1, $2], expr_alias: [v1, v2] } LogicalScan { table: t, columns: [_row_id#0, v1, v2] } - sql: | /* merge and then eliminate */ @@ -43,19 +43,19 @@ create table t (v1 bigint, v2 double precision); select * from (select * from t); logical_plan: | - LogicalProject { exprs: [$0, $1, $2], expr_alias: [_row_id#0, v1, v2] } - LogicalProject { exprs: [$0, $1, $2], expr_alias: [_row_id#0, v1, v2] } + LogicalProject { exprs: [$0, $1], expr_alias: [v1, v2] } + LogicalProject { exprs: [$1, $2], expr_alias: [v1, v2] } LogicalScan { table: t, columns: [_row_id#0, v1, v2] } optimized_logical_plan: | - LogicalScan { table: t, columns: [_row_id#0, v1, v2] } + LogicalScan { table: t, columns: [v1, v2] } - sql: | /* joins */ create table t (v1 bigint, v2 double precision); select * from (select * from t), t; logical_plan: | - LogicalProject { exprs: [$0, $1, $2, $3, $4, $5], expr_alias: [_row_id#0, v1, v2, _row_id#0, v1, v2] } + LogicalProject { exprs: [$0, $1, $3, $4], expr_alias: [v1, v2, v1, v2] } LogicalJoin { type: Inner, on: true:Boolean } - LogicalProject { exprs: [$0, $1, $2], expr_alias: [_row_id#0, v1, v2] } + LogicalProject { exprs: [$1, $2], expr_alias: [v1, v2] } LogicalScan { table: t, columns: [_row_id#0, v1, v2] } LogicalScan { table: t, columns: [_row_id#0, v1, v2] } - sql: | diff --git a/rust/frontend/test_runner/tests/testdata/subquery_expr.yaml b/rust/frontend/test_runner/tests/testdata/subquery_expr.yaml index 062de30904adc..31794f1df228f 100644 --- a/rust/frontend/test_runner/tests/testdata/subquery_expr.yaml +++ b/rust/frontend/test_runner/tests/testdata/subquery_expr.yaml @@ -61,7 +61,7 @@ LogicalValues { rows: [[]], schema: Schema { fields: [] } } LogicalProject { exprs: [($0 >= 1:Int32)], expr_alias: [ ] } LogicalAgg { group_keys: [], agg_calls: [count] } - LogicalProject { exprs: [$0, $1], expr_alias: [_row_id#0, x] } + LogicalProject { exprs: [$1], expr_alias: [x] } LogicalScan { table: t, columns: [_row_id#0, x] } - sql: | create table t1(x int); @@ -86,7 +86,7 @@ LogicalScan { table: t, columns: [_row_id#0, x] } LogicalProject { exprs: [($0 >= 1:Int32)], expr_alias: [ ] } LogicalAgg { group_keys: [], agg_calls: [count] } - LogicalProject { exprs: [$0, $1], expr_alias: [_row_id#0, x] } + LogicalProject { exprs: [$1], expr_alias: [x] } LogicalScan { table: t, columns: [_row_id#0, x] } - sql: | create table t1(x int);