diff --git a/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index b/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index index da50b7e37239..0e70d5bcd760 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index @@ -19,16 +19,16 @@ vectorized: true │ auto commit │ └── • render - │ columns: (column7, column1, check1) + │ columns: (crdb_internal_a_shard_11_cast, column1, check1) │ estimated row count: 2 - │ render check1: column7 IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + │ render check1: crdb_internal_a_shard_11_cast IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) │ render column1: column1 - │ render column7: column7 + │ render crdb_internal_a_shard_11_cast: crdb_internal_a_shard_11_cast │ └── • render - │ columns: (column7, column1) + │ columns: (crdb_internal_a_shard_11_cast, column1) │ estimated row count: 2 - │ render column7: crdb_internal.assignment_cast(mod(fnv32(crdb_internal.datums_to_bytes(column1)), 11), NULL::INT4) + │ render crdb_internal_a_shard_11_cast: crdb_internal.assignment_cast(mod(fnv32(crdb_internal.datums_to_bytes(column1)), 11), NULL::INT4) │ render column1: column1 │ └── • values @@ -53,17 +53,17 @@ vectorized: true │ auto commit │ └── • render - │ columns: (column1, column9, rowid_default, check1) + │ columns: (column1, crdb_internal_a_shard_12_cast, rowid_default, check1) │ estimated row count: 2 - │ render check1: column9 IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) + │ render check1: crdb_internal_a_shard_12_cast IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) │ render column1: column1 │ render rowid_default: rowid_default - │ render column9: column9 + │ render crdb_internal_a_shard_12_cast: crdb_internal_a_shard_12_cast │ └── • render - │ columns: (column9, rowid_default, column1) + │ columns: (crdb_internal_a_shard_12_cast, rowid_default, column1) │ estimated row count: 2 - │ render column9: crdb_internal.assignment_cast(mod(fnv32(crdb_internal.datums_to_bytes(column1)), 12), NULL::INT4) + │ render crdb_internal_a_shard_12_cast: crdb_internal.assignment_cast(mod(fnv32(crdb_internal.datums_to_bytes(column1)), 12), NULL::INT4) │ render rowid_default: unique_rowid() │ render column1: column1 │ diff --git a/pkg/sql/opt/exec/explain/testdata/gists_tpce b/pkg/sql/opt/exec/explain/testdata/gists_tpce index 663e5aff49e8..10bd15ed0711 100644 --- a/pkg/sql/opt/exec/explain/testdata/gists_tpce +++ b/pkg/sql/opt/exec/explain/testdata/gists_tpce @@ -349,7 +349,7 @@ explain(shape): │ │ │ └── • lookup join (anti) │ │ table: status_type@status_type_pkey -│ │ equality: (column62) = (st_id) +│ │ equality: (th_st_id_cast) = (st_id) │ │ equality cols are key │ │ │ └── • scan buffer @@ -361,7 +361,7 @@ explain(shape): │ └── • lookup join (anti) │ table: status_type@status_type_pkey - │ equality: (column127) = (st_id) + │ equality: (t_st_id_cast) = (st_id) │ equality cols are key │ └── • scan buffer diff --git a/pkg/sql/opt/norm/testdata/rules/fold_constants b/pkg/sql/opt/norm/testdata/rules/fold_constants index d62ce70b33f6..43b029aa289f 100644 --- a/pkg/sql/opt/norm/testdata/rules/fold_constants +++ b/pkg/sql/opt/norm/testdata/rules/fold_constants @@ -832,15 +832,15 @@ INSERT INTO assn_cast (c, qc, i, s) VALUES (' ', 'foo', '1', 2) insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column12:12 => c:1 - │ ├── column13:13 => qc:2 + │ ├── c_cast:12 => c:1 + │ ├── qc_cast:13 => qc:2 │ ├── column3:10 => i:3 - │ ├── column14:14 => s:4 + │ ├── s_cast:14 => s:4 │ └── rowid_default:15 => rowid:5 ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: column3:10!null column12:12!null column13:13!null column14:14!null rowid_default:15 + ├── columns: column3:10!null c_cast:12!null qc_cast:13!null s_cast:14!null rowid_default:15 ├── cardinality: [1 - 1] ├── volatile ├── key: () @@ -854,7 +854,7 @@ INSERT INTO assn_cast (c) VALUES ('foo') insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column9:9 => c:1 + │ ├── c_cast:9 => c:1 │ ├── qc_default:10 => qc:2 │ ├── i_default:11 => i:3 │ ├── s_default:12 => s:4 @@ -862,7 +862,7 @@ insert assn_cast ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: column9:9 qc_default:10 i_default:11 s_default:12 rowid_default:13 + ├── columns: c_cast:9 qc_default:10 i_default:11 s_default:12 rowid_default:13 ├── cardinality: [1 - 1] ├── volatile ├── key: () @@ -882,7 +882,7 @@ INSERT INTO assn_cast(c) VALUES ($1) insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column9:9 => c:1 + │ ├── c_cast:9 => c:1 │ ├── qc_default:10 => qc:2 │ ├── i_default:11 => i:3 │ ├── s_default:12 => s:4 @@ -890,7 +890,7 @@ insert assn_cast ├── cardinality: [0 - 0] ├── volatile, mutations, has-placeholder └── values - ├── columns: column9:9 qc_default:10 i_default:11 s_default:12 rowid_default:13 + ├── columns: c_cast:9 qc_default:10 i_default:11 s_default:12 rowid_default:13 ├── cardinality: [1 - 1] ├── volatile, has-placeholder ├── key: () @@ -913,12 +913,12 @@ insert assn_cast │ ├── c_default:10 => c:1 │ ├── qc_default:11 => qc:2 │ ├── i_default:12 => i:3 - │ ├── column9:9 => s:4 + │ ├── s_cast:9 => s:4 │ └── rowid_default:13 => rowid:5 ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: column9:9!null c_default:10 qc_default:11 i_default:12 rowid_default:13 + ├── columns: s_cast:9!null c_default:10 qc_default:11 i_default:12 rowid_default:13 ├── cardinality: [1 - 1] ├── volatile ├── key: () @@ -935,12 +935,12 @@ insert assn_cast │ ├── c_default:10 => c:1 │ ├── qc_default:11 => qc:2 │ ├── i_default:12 => i:3 - │ ├── column9:9 => s:4 + │ ├── s_cast:9 => s:4 │ └── rowid_default:13 => rowid:5 ├── cardinality: [0 - 0] ├── stable+volatile, mutations └── values - ├── columns: column9:9 c_default:10 qc_default:11 i_default:12 rowid_default:13 + ├── columns: s_cast:9 c_default:10 qc_default:11 i_default:12 rowid_default:13 ├── cardinality: [1 - 1] ├── stable+volatile ├── key: () diff --git a/pkg/sql/opt/norm/testdata/rules/project b/pkg/sql/opt/norm/testdata/rules/project index 79cbb17545fc..22a638f168c8 100644 --- a/pkg/sql/opt/norm/testdata/rules/project +++ b/pkg/sql/opt/norm/testdata/rules/project @@ -1050,19 +1050,19 @@ INSERT INTO assn_cast (c, qc, i, s) VALUES (' ', 'foo', '1', 2), ('bar', 'baz', insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column12:12 => c:1 - │ ├── column13:13 => qc:2 + │ ├── c_cast:12 => c:1 + │ ├── qc_cast:13 => qc:2 │ ├── column3:10 => i:3 - │ ├── column14:14 => s:4 + │ ├── s_cast:14 => s:4 │ └── rowid_default:15 => rowid:5 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: rowid_default:15 column3:10!null column12:12 column13:13!null column14:14!null + ├── columns: rowid_default:15 column3:10!null c_cast:12 qc_cast:13!null s_cast:14!null ├── cardinality: [2 - 2] ├── volatile ├── values - │ ├── columns: column12:12 column13:13!null column3:10!null column14:14!null + │ ├── columns: c_cast:12 qc_cast:13!null column3:10!null s_cast:14!null │ ├── cardinality: [2 - 2] │ ├── immutable │ ├── ('', 'f', 1, '2') @@ -1082,19 +1082,19 @@ INSERT INTO assn_cast (c, qc, i, s) VALUES (' ', 'foo', 1, 'bar'), ($1, $2, $3, insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column12:12 => c:1 - │ ├── column13:13 => qc:2 + │ ├── c_cast:12 => c:1 + │ ├── qc_cast:13 => qc:2 │ ├── column3:10 => i:3 │ ├── column4:11 => s:4 │ └── rowid_default:14 => rowid:5 ├── cardinality: [0 - 0] ├── volatile, mutations, has-placeholder └── project - ├── columns: rowid_default:14 column3:10 column4:11 column12:12 column13:13 + ├── columns: rowid_default:14 column3:10 column4:11 c_cast:12 qc_cast:13 ├── cardinality: [2 - 2] ├── volatile, has-placeholder ├── values - │ ├── columns: column12:12 column13:13 column3:10 column4:11 + │ ├── columns: c_cast:12 qc_cast:13 column3:10 column4:11 │ ├── cardinality: [2 - 2] │ ├── immutable, has-placeholder │ ├── ('', 'f', 1, 'bar') @@ -1116,28 +1116,28 @@ INSERT INTO assn_cast (c, qc, i, s) (SELECT ' ', 'foo', '1', unnest(ARRAY[1, 2, insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column12:12 => c:1 - │ ├── column13:13 => qc:2 + │ ├── c_cast:12 => c:1 + │ ├── qc_cast:13 => qc:2 │ ├── "?column?":11 => i:3 - │ ├── column14:14 => s:4 + │ ├── s_cast:14 => s:4 │ └── rowid_default:15 => rowid:5 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: rowid_default:15 column12:12!null column13:13!null "?column?":11!null column14:14!null + ├── columns: rowid_default:15 c_cast:12!null qc_cast:13!null "?column?":11!null s_cast:14!null ├── cardinality: [3 - 3] ├── volatile ├── fd: ()-->(11-13) ├── values - │ ├── columns: column14:14!null + │ ├── columns: s_cast:14!null │ ├── cardinality: [3 - 3] │ ├── ('1',) │ ├── ('2',) │ └── ('3',) └── projections ├── unique_rowid() [as=rowid_default:15, volatile] - ├── '' [as=column12:12] - ├── 'f' [as=column13:13] + ├── '' [as=c_cast:12] + ├── 'f' [as=qc_cast:13] └── 1 [as="?column?":11] # Do not push assignment casts into values when other projections reference the diff --git a/pkg/sql/opt/optbuilder/mutation_builder.go b/pkg/sql/opt/optbuilder/mutation_builder.go index def38fe00641..caa2064fd904 100644 --- a/pkg/sql/opt/optbuilder/mutation_builder.go +++ b/pkg/sql/opt/optbuilder/mutation_builder.go @@ -1441,7 +1441,7 @@ func (mb *mutationBuilder) addAssignmentCasts(srcCols opt.OptionalColList) { // two columns with different names but the same ID. To get the correct // column, we perform a lookup with the ID and the name. See #61520. scopeCol := projectionScope.getColumnWithIDAndReferenceName(colID, targetCol.ColName()) - scopeCol.name = scopeCol.name.WithMetadataName("") + scopeCol.name = scopeCol.name.WithMetadataName(fmt.Sprintf("%s_cast", targetCol.ColName())) mb.b.populateSynthesizedColumn(scopeCol, cast) // Replace old source column with the new one. diff --git a/pkg/sql/opt/optbuilder/testdata/fk-on-update-cascade b/pkg/sql/opt/optbuilder/testdata/fk-on-update-cascade index b0d2852e3693..19a854ba08ee 100644 --- a/pkg/sql/opt/optbuilder/testdata/fk-on-update-cascade +++ b/pkg/sql/opt/optbuilder/testdata/fk-on-update-cascade @@ -752,12 +752,12 @@ root │ ├── columns: │ ├── fetch columns: p:4 │ ├── update-mapping: - │ │ └── column8:8 => p:1 + │ │ └── p_cast:8 => p:1 │ ├── input binding: &1 │ ├── cascades │ │ └── child_assn_cast_p_fkey │ └── project - │ ├── columns: column8:8!null p:4!null crdb_internal_mvcc_timestamp:5 tableoid:6 + │ ├── columns: p_cast:8!null p:4!null crdb_internal_mvcc_timestamp:5 tableoid:6 │ ├── project │ │ ├── columns: p_new:7!null p:4!null crdb_internal_mvcc_timestamp:5 tableoid:6 │ │ ├── select @@ -769,17 +769,17 @@ root │ │ └── projections │ │ └── 1.45 [as=p_new:7] │ └── projections - │ └── assignment-cast: DECIMAL(10,2) [as=column8:8] + │ └── assignment-cast: DECIMAL(10,2) [as=p_cast:8] │ └── p_new:7 └── cascade └── update child_assn_cast ├── columns: ├── fetch columns: c:13 child_assn_cast.p:14 ├── update-mapping: - │ └── column19:19 => child_assn_cast.p:10 + │ └── p_cast:19 => child_assn_cast.p:10 ├── input binding: &2 ├── project - │ ├── columns: column19:19!null c:13!null child_assn_cast.p:14!null p_old:17!null p_new:18!null + │ ├── columns: p_cast:19!null c:13!null child_assn_cast.p:14!null p_old:17!null p_new:18!null │ ├── inner-join (hash) │ │ ├── columns: c:13!null child_assn_cast.p:14!null p_old:17!null p_new:18!null │ │ ├── scan child_assn_cast @@ -790,13 +790,13 @@ root │ │ │ │ ├── columns: p_old:17!null p_new:18!null │ │ │ │ └── mapping: │ │ │ │ ├── parent_assn_cast.p:4 => p_old:17 - │ │ │ │ └── column8:8 => p_new:18 + │ │ │ │ └── p_cast:8 => p_new:18 │ │ │ └── filters │ │ │ └── p_old:17 IS DISTINCT FROM p_new:18 │ │ └── filters │ │ └── child_assn_cast.p:14 = p_old:17 │ └── projections - │ └── assignment-cast: DECIMAL(10) [as=column19:19] + │ └── assignment-cast: DECIMAL(10) [as=p_cast:19] │ └── p_new:18 └── f-k-checks └── f-k-checks-item: child_assn_cast(p) -> parent_assn_cast(p) @@ -805,7 +805,7 @@ root ├── with-scan &2 │ ├── columns: p:20!null │ └── mapping: - │ └── column19:19 => p:20 + │ └── p_cast:19 => p:20 ├── scan parent_assn_cast │ └── columns: parent_assn_cast.p:21!null └── filters @@ -1326,13 +1326,13 @@ root ├── columns: ├── fetch columns: t.public.child_diff_type.c:12(int) t.public.child_diff_type.p:13(int2) ├── update-mapping: - │ └── column18:18 => t.public.child_diff_type.p:9 + │ └── p_cast:18 => t.public.child_diff_type.p:9 ├── input binding: &2 ├── cardinality: [0 - 0] ├── volatile, mutations ├── stats: [rows=0] ├── project - │ ├── columns: column18:18(int2!null) t.public.child_diff_type.c:12(int!null) t.public.child_diff_type.p:13(int2!null) p_old:16(int!null) p_new:17(int!null) + │ ├── columns: p_cast:18(int2!null) t.public.child_diff_type.c:12(int!null) t.public.child_diff_type.p:13(int2!null) p_old:16(int!null) p_new:17(int!null) │ ├── immutable │ ├── stats: [rows=3.3, distinct(18)=0.333317413, null(18)=0] │ ├── key: (12) @@ -1376,7 +1376,7 @@ root │ │ ├── variable: t.public.child_diff_type.p:13 [type=int2] │ │ └── variable: p_old:16 [type=int] │ └── projections - │ └── assignment-cast: INT2 [as=column18:18, type=int2, outer=(17), immutable] + │ └── assignment-cast: INT2 [as=p_cast:18, type=int2, outer=(17), immutable] │ └── variable: p_new:17 [type=int] └── f-k-checks └── f-k-checks-item: child_diff_type(p) -> parent_diff_type(p) @@ -1389,7 +1389,7 @@ root ├── with-scan &2 │ ├── columns: p:19(int2!null) │ ├── mapping: - │ │ └── column18:18(int2) => p:19(int2) + │ │ └── p_cast:18(int2) => p:19(int2) │ ├── stats: [rows=3.3, distinct(19)=0.333317413, null(19)=0] │ ├── fd: ()-->(19) │ └── cte-uses diff --git a/pkg/sql/opt/optbuilder/testdata/fk-on-update-set-default b/pkg/sql/opt/optbuilder/testdata/fk-on-update-set-default index b9e305a080d6..d1b6ee113f6f 100644 --- a/pkg/sql/opt/optbuilder/testdata/fk-on-update-set-default +++ b/pkg/sql/opt/optbuilder/testdata/fk-on-update-set-default @@ -804,10 +804,10 @@ root ├── columns: ├── fetch columns: c:12 child_assn_cast.p:13 ├── update-mapping: - │ └── column19:19 => child_assn_cast.p:9 + │ └── p_cast:19 => child_assn_cast.p:9 ├── input binding: &2 ├── project - │ ├── columns: column19:19!null c:12!null child_assn_cast.p:13!null p_old:16!null p_new:17!null + │ ├── columns: p_cast:19!null c:12!null child_assn_cast.p:13!null p_old:16!null p_new:17!null │ ├── project │ │ ├── columns: p_new:18!null c:12!null child_assn_cast.p:13!null p_old:16!null p_new:17!null │ │ ├── inner-join (cross) @@ -828,7 +828,7 @@ root │ │ └── projections │ │ └── 1.45::DECIMAL(10,2) [as=p_new:18] │ └── projections - │ └── assignment-cast: DECIMAL(10) [as=column19:19] + │ └── assignment-cast: DECIMAL(10) [as=p_cast:19] │ └── p_new:18 └── f-k-checks └── f-k-checks-item: child_assn_cast(p) -> parent_assn_cast(p) @@ -837,7 +837,7 @@ root ├── with-scan &2 │ ├── columns: p:20!null │ └── mapping: - │ └── column19:19 => p:20 + │ └── p_cast:19 => p:20 ├── scan parent_assn_cast │ └── columns: parent_assn_cast.p:21!null └── filters diff --git a/pkg/sql/opt/optbuilder/testdata/insert b/pkg/sql/opt/optbuilder/testdata/insert index 6c2257af8d5a..699a1e42a4bb 100644 --- a/pkg/sql/opt/optbuilder/testdata/insert +++ b/pkg/sql/opt/optbuilder/testdata/insert @@ -759,18 +759,18 @@ INSERT INTO xyz (x) VALUES (10) insert xyz ├── columns: ├── insert-mapping: - │ ├── column7:7 => x:1 + │ ├── x_cast:7 => x:1 │ ├── y_default:8 => y:2 │ └── z_default:9 => z:3 └── project - ├── columns: y_default:8 z_default:9 column7:7!null + ├── columns: y_default:8 z_default:9 x_cast:7!null ├── project - │ ├── columns: column7:7!null + │ ├── columns: x_cast:7!null │ ├── values │ │ ├── columns: column1:6!null │ │ └── (10,) │ └── projections - │ └── assignment-cast: STRING [as=column7:7] + │ └── assignment-cast: STRING [as=x_cast:7] │ └── column1:6 └── projections ├── NULL::INT8 [as=y_default:8] @@ -1190,44 +1190,44 @@ INSERT INTO decimals (a, b) VALUES (1.1, ARRAY[0.95, NULL, 15]) insert decimals ├── columns: ├── insert-mapping: - │ ├── column9:9 => a:1 - │ ├── column10:10 => b:2 - │ ├── column12:12 => c:3 - │ └── column14:14 => d:4 + │ ├── a_cast:9 => a:1 + │ ├── b_cast:10 => b:2 + │ ├── c_cast:12 => c:3 + │ └── d_cast:14 => d:4 ├── check columns: check1:15 check2:16 └── project - ├── columns: check1:15 check2:16 column9:9!null column10:10 column12:12!null column14:14!null + ├── columns: check1:15 check2:16 a_cast:9!null b_cast:10 c_cast:12!null d_cast:14!null ├── project - │ ├── columns: column14:14!null column9:9!null column10:10 column12:12!null + │ ├── columns: d_cast:14!null a_cast:9!null b_cast:10 c_cast:12!null │ ├── project - │ │ ├── columns: d_comp:13!null column9:9!null column10:10 column12:12!null + │ │ ├── columns: d_comp:13!null a_cast:9!null b_cast:10 c_cast:12!null │ │ ├── project - │ │ │ ├── columns: column12:12!null column9:9!null column10:10 + │ │ │ ├── columns: c_cast:12!null a_cast:9!null b_cast:10 │ │ │ ├── project - │ │ │ │ ├── columns: c_default:11!null column9:9!null column10:10 + │ │ │ │ ├── columns: c_default:11!null a_cast:9!null b_cast:10 │ │ │ │ ├── project - │ │ │ │ │ ├── columns: column9:9!null column10:10 + │ │ │ │ │ ├── columns: a_cast:9!null b_cast:10 │ │ │ │ │ ├── values │ │ │ │ │ │ ├── columns: column1:7!null column2:8 │ │ │ │ │ │ └── (1.1, ARRAY[0.95,NULL,15]) │ │ │ │ │ └── projections - │ │ │ │ │ ├── assignment-cast: DECIMAL(10) [as=column9:9] + │ │ │ │ │ ├── assignment-cast: DECIMAL(10) [as=a_cast:9] │ │ │ │ │ │ └── column1:7 - │ │ │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=column10:10] + │ │ │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=b_cast:10] │ │ │ │ │ └── column2:8 │ │ │ │ └── projections │ │ │ │ └── 1.23 [as=c_default:11] │ │ │ └── projections - │ │ │ └── assignment-cast: DECIMAL(10,1) [as=column12:12] + │ │ │ └── assignment-cast: DECIMAL(10,1) [as=c_cast:12] │ │ │ └── c_default:11 │ │ └── projections - │ │ └── column9:9::DECIMAL + column12:12::DECIMAL [as=d_comp:13] + │ │ └── a_cast:9::DECIMAL + c_cast:12::DECIMAL [as=d_comp:13] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column14:14] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:14] │ └── d_comp:13 └── projections - ├── round(column9:9) = column9:9 [as=check1:15] - └── column10:10[0] > 1 [as=check2:16] + ├── round(a_cast:9) = a_cast:9 [as=check1:15] + └── b_cast:10[0] > 1 [as=check2:16] assign-placeholders-build query-args=(1.1, (ARRAY[0.95, NULL, 15])) INSERT INTO decimals (a, b) VALUES ($1, $2) @@ -1235,44 +1235,44 @@ INSERT INTO decimals (a, b) VALUES ($1, $2) insert decimals ├── columns: ├── insert-mapping: - │ ├── column9:9 => a:1 - │ ├── column10:10 => b:2 - │ ├── column12:12 => c:3 - │ └── column14:14 => d:4 + │ ├── a_cast:9 => a:1 + │ ├── b_cast:10 => b:2 + │ ├── c_cast:12 => c:3 + │ └── d_cast:14 => d:4 ├── check columns: check1:15 check2:16 └── project - ├── columns: check1:15 check2:16 column9:9!null column10:10!null column12:12!null column14:14!null + ├── columns: check1:15 check2:16 a_cast:9!null b_cast:10!null c_cast:12!null d_cast:14!null ├── project - │ ├── columns: column14:14!null column9:9!null column10:10!null column12:12!null + │ ├── columns: d_cast:14!null a_cast:9!null b_cast:10!null c_cast:12!null │ ├── project - │ │ ├── columns: d_comp:13!null column9:9!null column10:10!null column12:12!null + │ │ ├── columns: d_comp:13!null a_cast:9!null b_cast:10!null c_cast:12!null │ │ ├── project - │ │ │ ├── columns: column12:12!null column9:9!null column10:10!null + │ │ │ ├── columns: c_cast:12!null a_cast:9!null b_cast:10!null │ │ │ ├── project - │ │ │ │ ├── columns: c_default:11!null column9:9!null column10:10!null + │ │ │ │ ├── columns: c_default:11!null a_cast:9!null b_cast:10!null │ │ │ │ ├── project - │ │ │ │ │ ├── columns: column9:9!null column10:10!null + │ │ │ │ │ ├── columns: a_cast:9!null b_cast:10!null │ │ │ │ │ ├── values │ │ │ │ │ │ ├── columns: column1:7!null column2:8!null │ │ │ │ │ │ └── (1.1, ARRAY[0.95,NULL,15]) │ │ │ │ │ └── projections - │ │ │ │ │ ├── assignment-cast: DECIMAL(10) [as=column9:9] + │ │ │ │ │ ├── assignment-cast: DECIMAL(10) [as=a_cast:9] │ │ │ │ │ │ └── column1:7 - │ │ │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=column10:10] + │ │ │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=b_cast:10] │ │ │ │ │ └── column2:8 │ │ │ │ └── projections │ │ │ │ └── 1.23 [as=c_default:11] │ │ │ └── projections - │ │ │ └── assignment-cast: DECIMAL(10,1) [as=column12:12] + │ │ │ └── assignment-cast: DECIMAL(10,1) [as=c_cast:12] │ │ │ └── c_default:11 │ │ └── projections - │ │ └── column9:9::DECIMAL + column12:12::DECIMAL [as=d_comp:13] + │ │ └── a_cast:9::DECIMAL + c_cast:12::DECIMAL [as=d_comp:13] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column14:14] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:14] │ └── d_comp:13 └── projections - ├── round(column9:9) = column9:9 [as=check1:15] - └── column10:10[0] > 1 [as=check2:16] + ├── round(a_cast:9) = a_cast:9 [as=check1:15] + └── b_cast:10[0] > 1 [as=check2:16] build INSERT INTO assn_cast (c, qc, i, s) VALUES (' ', 'foo', '1', 2) @@ -1280,24 +1280,24 @@ INSERT INTO assn_cast (c, qc, i, s) VALUES (' ', 'foo', '1', 2) insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column12:12 => c:1 - │ ├── column13:13 => qc:2 + │ ├── c_cast:12 => c:1 + │ ├── qc_cast:13 => qc:2 │ ├── column3:10 => i:3 - │ ├── column14:14 => s:4 + │ ├── s_cast:14 => s:4 │ └── rowid_default:15 => rowid:5 └── project - ├── columns: rowid_default:15 column3:10!null column12:12!null column13:13!null column14:14!null + ├── columns: rowid_default:15 column3:10!null c_cast:12!null qc_cast:13!null s_cast:14!null ├── project - │ ├── columns: column12:12!null column13:13!null column14:14!null column3:10!null + │ ├── columns: c_cast:12!null qc_cast:13!null s_cast:14!null column3:10!null │ ├── values │ │ ├── columns: column1:8!null column2:9!null column3:10!null column4:11!null │ │ └── (' ', 'foo', 1, 2) │ └── projections - │ ├── assignment-cast: CHAR [as=column12:12] + │ ├── assignment-cast: CHAR [as=c_cast:12] │ │ └── column1:8 - │ ├── assignment-cast: "char" [as=column13:13] + │ ├── assignment-cast: "char" [as=qc_cast:13] │ │ └── column2:9 - │ └── assignment-cast: STRING [as=column14:14] + │ └── assignment-cast: STRING [as=s_cast:14] │ └── column4:11 └── projections └── unique_rowid() [as=rowid_default:15] @@ -1308,22 +1308,22 @@ INSERT INTO assn_cast (c, qc, i) VALUES ($1, $2, $3) insert assn_cast ├── columns: ├── insert-mapping: - │ ├── column11:11 => c:1 - │ ├── column12:12 => qc:2 + │ ├── c_cast:11 => c:1 + │ ├── qc_cast:12 => qc:2 │ ├── column3:10 => i:3 │ ├── s_default:13 => s:4 │ └── rowid_default:14 => rowid:5 └── project - ├── columns: s_default:13 rowid_default:14 column3:10!null column11:11!null column12:12!null + ├── columns: s_default:13 rowid_default:14 column3:10!null c_cast:11!null qc_cast:12!null ├── project - │ ├── columns: column11:11!null column12:12!null column3:10!null + │ ├── columns: c_cast:11!null qc_cast:12!null column3:10!null │ ├── values │ │ ├── columns: column1:8!null column2:9!null column3:10!null │ │ └── (' ', 'foo', 1) │ └── projections - │ ├── assignment-cast: CHAR [as=column11:11] + │ ├── assignment-cast: CHAR [as=c_cast:11] │ │ └── column1:8 - │ └── assignment-cast: "char" [as=column12:12] + │ └── assignment-cast: "char" [as=qc_cast:12] │ └── column2:9 └── projections ├── NULL::STRING [as=s_default:13] @@ -1348,14 +1348,14 @@ insert assn_cast_default ├── columns: ├── insert-mapping: │ ├── column1:10 => k:1 - │ ├── column17:17 => i2:2 - │ ├── column18:18 => c1:3 - │ ├── column19:19 => c2:4 - │ ├── column20:20 => d1:5 - │ ├── column21:21 => d2:6 + │ ├── i2_cast:17 => i2:2 + │ ├── c1_cast:18 => c1:3 + │ ├── c2_cast:19 => c2:4 + │ ├── d1_cast:20 => d1:5 + │ ├── d2_cast:21 => d2:6 │ └── s_default:16 => s:7 └── project - ├── columns: column17:17!null column18:18!null column19:19!null column20:20!null column21:21!null column1:10!null s_default:16 + ├── columns: i2_cast:17!null c1_cast:18!null c2_cast:19!null d1_cast:20!null d2_cast:21!null column1:10!null s_default:16 ├── project │ ├── columns: i2_default:11!null c1_default:12!null c2_default:13!null d1_default:14!null d2_default:15!null s_default:16 column1:10!null │ ├── values @@ -1369,15 +1369,15 @@ insert assn_cast_default │ ├── 4.56::DECIMAL(10,2) [as=d2_default:15] │ └── NULL::STRING [as=s_default:16] └── projections - ├── assignment-cast: INT2 [as=column17:17] + ├── assignment-cast: INT2 [as=i2_cast:17] │ └── i2_default:11 - ├── assignment-cast: CHAR [as=column18:18] + ├── assignment-cast: CHAR [as=c1_cast:18] │ └── c1_default:12 - ├── assignment-cast: CHAR [as=column19:19] + ├── assignment-cast: CHAR [as=c2_cast:19] │ └── c2_default:13 - ├── assignment-cast: DECIMAL(10) [as=column20:20] + ├── assignment-cast: DECIMAL(10) [as=d1_cast:20] │ └── d1_default:14 - └── assignment-cast: DECIMAL(10) [as=column21:21] + └── assignment-cast: DECIMAL(10) [as=d2_cast:21] └── d2_default:15 exec-ddl @@ -1400,32 +1400,32 @@ insert assn_cast_comp ├── insert-mapping: │ ├── column1:10 => k:1 │ ├── column2:11 => i:2 - │ ├── column17:17 => i_comp:3 + │ ├── i_comp_cast:17 => i_comp:3 │ ├── column3:12 => t:4 - │ ├── column18:18 => c_comp:5 - │ ├── column14:14 => d:6 - │ └── column19:19 => d_comp:7 + │ ├── c_comp_cast:18 => c_comp:5 + │ ├── d_cast:14 => d:6 + │ └── d_comp_cast:19 => d_comp:7 └── project - ├── columns: column17:17!null column18:18!null column19:19!null column1:10!null column2:11!null column3:12!null column14:14!null + ├── columns: i_comp_cast:17!null c_comp_cast:18!null d_comp_cast:19!null column1:10!null column2:11!null column3:12!null d_cast:14!null ├── project - │ ├── columns: i_comp_comp:15!null d_comp_comp:16!null column1:10!null column2:11!null column3:12!null column14:14!null + │ ├── columns: i_comp_comp:15!null d_comp_comp:16!null column1:10!null column2:11!null column3:12!null d_cast:14!null │ ├── project - │ │ ├── columns: column14:14!null column1:10!null column2:11!null column3:12!null + │ │ ├── columns: d_cast:14!null column1:10!null column2:11!null column3:12!null │ │ ├── values │ │ │ ├── columns: column1:10!null column2:11!null column3:12!null column4:13!null │ │ │ └── (1, 2, 'foo', 1.56) │ │ └── projections - │ │ └── assignment-cast: DECIMAL(10) [as=column14:14] + │ │ └── assignment-cast: DECIMAL(10) [as=d_cast:14] │ │ └── column4:13 │ └── projections │ ├── column2:11 + 10 [as=i_comp_comp:15] - │ └── column14:14::DECIMAL + 2.5 [as=d_comp_comp:16] + │ └── d_cast:14::DECIMAL + 2.5 [as=d_comp_comp:16] └── projections - ├── assignment-cast: INT2 [as=column17:17] + ├── assignment-cast: INT2 [as=i_comp_cast:17] │ └── i_comp_comp:15 - ├── assignment-cast: CHAR [as=column18:18] + ├── assignment-cast: CHAR [as=c_comp_cast:18] │ └── column3:12 - └── assignment-cast: DECIMAL(10) [as=column19:19] + └── assignment-cast: DECIMAL(10) [as=d_comp_cast:19] └── d_comp_comp:16 # Regression test for #38293; the default values should be separate projections. diff --git a/pkg/sql/opt/optbuilder/testdata/partial-indexes b/pkg/sql/opt/optbuilder/testdata/partial-indexes index 464b6bcb0eee..b640c273f832 100644 --- a/pkg/sql/opt/optbuilder/testdata/partial-indexes +++ b/pkg/sql/opt/optbuilder/testdata/partial-indexes @@ -557,13 +557,13 @@ project ├── columns: a:1!null rowid:2!null column1:9 ├── fetch columns: a:5 rowid:6 ├── update-mapping: - │ └── column10:10 => a:1 + │ └── a_cast:10 => a:1 ├── partial index put columns: partial_index_put1:11 ├── partial index del columns: partial_index_del1:12 └── project - ├── columns: partial_index_put1:11!null partial_index_del1:12!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null column10:10!null + ├── columns: partial_index_put1:11!null partial_index_del1:12!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null a_cast:10!null ├── project - │ ├── columns: column10:10!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null + │ ├── columns: a_cast:10!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null │ ├── select │ │ ├── columns: a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null │ │ ├── inner-join (cross) @@ -580,10 +580,10 @@ project │ │ └── filters │ │ └── a:5 = column1:9 │ └── projections - │ └── assignment-cast: DECIMAL(10,2) [as=column10:10] + │ └── assignment-cast: DECIMAL(10,2) [as=a_cast:10] │ └── column1:9 └── projections - ├── column10:10 > 0 [as=partial_index_put1:11] + ├── a_cast:10 > 0 [as=partial_index_put1:11] └── a:5 > 0 [as=partial_index_del1:12] # -- UPSERT / INSERT ON CONFLICT tests -- diff --git a/pkg/sql/opt/optbuilder/testdata/update b/pkg/sql/opt/optbuilder/testdata/update index 40b731d056c4..c5d2e0a36660 100644 --- a/pkg/sql/opt/optbuilder/testdata/update +++ b/pkg/sql/opt/optbuilder/testdata/update @@ -528,11 +528,11 @@ update xyz ├── columns: ├── fetch columns: x:6 y:7 z:8 ├── update-mapping: - │ ├── column13:13 => x:1 + │ ├── x_cast:13 => x:1 │ ├── x_new:11 => y:2 │ └── z_new:12 => z:3 └── project - ├── columns: column13:13!null x:6!null y:7 z:8 crdb_internal_mvcc_timestamp:9 tableoid:10 x_new:11!null z_new:12!null + ├── columns: x_cast:13!null x:6!null y:7 z:8 crdb_internal_mvcc_timestamp:9 tableoid:10 x_new:11!null z_new:12!null ├── project │ ├── columns: x_new:11!null z_new:12!null x:6!null y:7 z:8 crdb_internal_mvcc_timestamp:9 tableoid:10 │ ├── scan xyz @@ -541,7 +541,7 @@ update xyz │ ├── 1 [as=x_new:11] │ └── 1.0 [as=z_new:12] └── projections - └── assignment-cast: STRING [as=column13:13] + └── assignment-cast: STRING [as=x_cast:13] └── x_new:11 build @@ -1668,18 +1668,18 @@ update decimals ├── columns: ├── fetch columns: a:7 b:8 c:9 d:10 ├── update-mapping: - │ ├── column15:15 => a:1 - │ ├── column16:16 => b:2 - │ └── column18:18 => d:4 + │ ├── a_cast:15 => a:1 + │ ├── b_cast:16 => b:2 + │ └── d_cast:18 => d:4 ├── check columns: check1:19 check2:20 └── project - ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16 column18:18 + ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16 d_cast:18 ├── project - │ ├── columns: column18:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16 + │ ├── columns: d_cast:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16 │ ├── project - │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16 + │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16 │ │ ├── project - │ │ │ ├── columns: column15:15!null column16:16 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 + │ │ │ ├── columns: a_cast:15!null b_cast:16 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ ├── project │ │ │ │ ├── columns: a_new:13!null b_new:14 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ │ ├── scan decimals @@ -1691,18 +1691,18 @@ update decimals │ │ │ │ ├── 1.1 [as=a_new:13] │ │ │ │ └── ARRAY[0.95, NULL, 15::DECIMAL(10,2)] [as=b_new:14] │ │ │ └── projections - │ │ │ ├── assignment-cast: DECIMAL(10) [as=column15:15] + │ │ │ ├── assignment-cast: DECIMAL(10) [as=a_cast:15] │ │ │ │ └── a_new:13 - │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=column16:16] + │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=b_cast:16] │ │ │ └── b_new:14 │ │ └── projections - │ │ └── column15:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] + │ │ └── a_cast:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column18:18] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:18] │ └── d_comp:17 └── projections - ├── round(column15:15) = column15:15 [as=check1:19] - └── column16:16[0] > 1 [as=check2:20] + ├── round(a_cast:15) = a_cast:15 [as=check1:19] + └── b_cast:16[0] > 1 [as=check2:20] # Test standard prepared update with decimal types that require assignment # casts. @@ -1713,18 +1713,18 @@ update decimals ├── columns: ├── fetch columns: a:7 b:8 c:9 d:10 ├── update-mapping: - │ ├── column15:15 => a:1 - │ ├── column16:16 => b:2 - │ └── column18:18 => d:4 + │ ├── a_cast:15 => a:1 + │ ├── b_cast:16 => b:2 + │ └── d_cast:18 => d:4 ├── check columns: check1:19 check2:20 └── project - ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16!null column18:18 + ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16!null d_cast:18 ├── project - │ ├── columns: column18:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16!null + │ ├── columns: d_cast:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16!null │ ├── project - │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16!null + │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16!null │ │ ├── project - │ │ │ ├── columns: column15:15!null column16:16!null a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 + │ │ │ ├── columns: a_cast:15!null b_cast:16!null a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ ├── project │ │ │ │ ├── columns: a_new:13!null b_new:14!null a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ │ ├── scan decimals @@ -1736,18 +1736,18 @@ update decimals │ │ │ │ ├── 1.1 [as=a_new:13] │ │ │ │ └── ARRAY[0.95,NULL,15.00] [as=b_new:14] │ │ │ └── projections - │ │ │ ├── assignment-cast: DECIMAL(10) [as=column15:15] + │ │ │ ├── assignment-cast: DECIMAL(10) [as=a_cast:15] │ │ │ │ └── a_new:13 - │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=column16:16] + │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=b_cast:16] │ │ │ └── b_new:14 │ │ └── projections - │ │ └── column15:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] + │ │ └── a_cast:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column18:18] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:18] │ └── d_comp:17 └── projections - ├── round(column15:15) = column15:15 [as=check1:19] - └── column16:16[0] > 1 [as=check2:20] + ├── round(a_cast:15) = a_cast:15 [as=check1:19] + └── b_cast:16[0] > 1 [as=check2:20] # Test standard update with some types that require assignment casts. build @@ -1757,14 +1757,14 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16 ├── update-mapping: - │ ├── column23:23 => c:1 - │ ├── column24:24 => qc:2 + │ ├── c_cast:23 => c:1 + │ ├── qc_cast:24 => qc:2 │ ├── i_new:21 => i:3 - │ └── column25:25 => s:4 + │ └── s_cast:25 => s:4 └── project - ├── columns: d_comp_comp:26 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null column23:23!null column24:24!null column25:25!null + ├── columns: d_comp_comp:26 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null c_cast:23!null qc_cast:24!null s_cast:25!null ├── project - │ ├── columns: column23:23!null column24:24!null column25:25!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null + │ ├── columns: c_cast:23!null qc_cast:24!null s_cast:25!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null │ ├── project │ │ ├── columns: c_new:19!null qc_new:20!null i_new:21!null s_new:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ ├── scan assn_cast @@ -1778,11 +1778,11 @@ update assn_cast │ │ ├── 1 [as=i_new:21] │ │ └── 2 [as=s_new:22] │ └── projections - │ ├── assignment-cast: CHAR [as=column23:23] + │ ├── assignment-cast: CHAR [as=c_cast:23] │ │ └── c_new:19 - │ ├── assignment-cast: "char" [as=column24:24] + │ ├── assignment-cast: "char" [as=qc_cast:24] │ │ └── qc_new:20 - │ └── assignment-cast: STRING [as=column25:25] + │ └── assignment-cast: STRING [as=s_cast:25] │ └── s_new:22 └── projections └── d:14::DECIMAL + 10.0 [as=d_comp_comp:26] @@ -1795,13 +1795,13 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16 ├── update-mapping: - │ ├── column22:22 => c:1 - │ ├── column23:23 => qc:2 + │ ├── c_cast:22 => c:1 + │ ├── qc_cast:23 => qc:2 │ └── i_new:21 => i:3 └── project - ├── columns: d_comp_comp:24 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null column22:22!null column23:23!null + ├── columns: d_comp_comp:24 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null c_cast:22!null qc_cast:23!null ├── project - │ ├── columns: column22:22!null column23:23!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null + │ ├── columns: c_cast:22!null qc_cast:23!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_new:21!null │ ├── project │ │ ├── columns: c_new:19!null qc_new:20!null i_new:21!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ ├── scan assn_cast @@ -1814,9 +1814,9 @@ update assn_cast │ │ ├── 'foo' [as=qc_new:20] │ │ └── 1 [as=i_new:21] │ └── projections - │ ├── assignment-cast: CHAR [as=column22:22] + │ ├── assignment-cast: CHAR [as=c_cast:22] │ │ └── c_new:19 - │ └── assignment-cast: "char" [as=column23:23] + │ └── assignment-cast: "char" [as=qc_cast:23] │ └── qc_new:20 └── projections └── d:14::DECIMAL + 10.0 [as=d_comp_comp:24] @@ -1829,11 +1829,11 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16 ├── update-mapping: - │ └── column20:20 => i:3 + │ └── i_cast:20 => i:3 └── project - ├── columns: d_comp_comp:21 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 column20:20!null + ├── columns: d_comp_comp:21 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 i_cast:20!null ├── project - │ ├── columns: column20:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 + │ ├── columns: i_cast:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ ├── project │ │ ├── columns: i_new:19!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ ├── scan assn_cast @@ -1844,7 +1844,7 @@ update assn_cast │ │ └── projections │ │ └── 10::INT2 [as=i_new:19] │ └── projections - │ └── assignment-cast: INT8 [as=column20:20] + │ └── assignment-cast: INT8 [as=i_cast:20] │ └── i_new:19 └── projections └── d:14::DECIMAL + 10.0 [as=d_comp_comp:21] @@ -1858,14 +1858,14 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16 ├── update-mapping: - │ ├── column20:20 => d:5 - │ └── column22:22 => d_comp:6 + │ ├── d_cast:20 => d:5 + │ └── d_comp_cast:22 => d_comp:6 └── project - ├── columns: column22:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 column20:20!null + ├── columns: d_comp_cast:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 d_cast:20!null ├── project - │ ├── columns: d_comp_comp:21!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 column20:20!null + │ ├── columns: d_comp_comp:21!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 d_cast:20!null │ ├── project - │ │ ├── columns: column20:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 + │ │ ├── columns: d_cast:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ ├── project │ │ │ ├── columns: d_new:19!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ │ ├── scan assn_cast @@ -1876,12 +1876,12 @@ update assn_cast │ │ │ └── projections │ │ │ └── 1.45::DECIMAL(10,2) [as=d_new:19] │ │ └── projections - │ │ └── assignment-cast: DECIMAL(10) [as=column20:20] + │ │ └── assignment-cast: DECIMAL(10) [as=d_cast:20] │ │ └── d_new:19 │ └── projections - │ └── column20:20::DECIMAL + 10.0 [as=d_comp_comp:21] + │ └── d_cast:20::DECIMAL + 10.0 [as=d_comp_comp:21] └── projections - └── assignment-cast: DECIMAL(10) [as=column22:22] + └── assignment-cast: DECIMAL(10) [as=d_comp_cast:22] └── d_comp_comp:21 # Test prepared update to a column that requires an assignment cast and a @@ -1893,14 +1893,14 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16 ├── update-mapping: - │ ├── column20:20 => d:5 - │ └── column22:22 => d_comp:6 + │ ├── d_cast:20 => d:5 + │ └── d_comp_cast:22 => d_comp:6 └── project - ├── columns: column22:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 column20:20!null + ├── columns: d_comp_cast:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 d_cast:20!null ├── project - │ ├── columns: d_comp_comp:21!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 column20:20!null + │ ├── columns: d_comp_comp:21!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 d_cast:20!null │ ├── project - │ │ ├── columns: column20:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 + │ │ ├── columns: d_cast:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ ├── project │ │ │ ├── columns: d_new:19!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ │ ├── scan assn_cast @@ -1911,12 +1911,12 @@ update assn_cast │ │ │ └── projections │ │ │ └── 1.45 [as=d_new:19] │ │ └── projections - │ │ └── assignment-cast: DECIMAL(10) [as=column20:20] + │ │ └── assignment-cast: DECIMAL(10) [as=d_cast:20] │ │ └── d_new:19 │ └── projections - │ └── column20:20::DECIMAL + 10.0 [as=d_comp_comp:21] + │ └── d_cast:20::DECIMAL + 10.0 [as=d_comp_comp:21] └── projections - └── assignment-cast: DECIMAL(10) [as=column22:22] + └── assignment-cast: DECIMAL(10) [as=d_comp_cast:22] └── d_comp_comp:21 # Test tuple-syntax update with assignment casts required. @@ -1927,18 +1927,18 @@ update decimals ├── columns: ├── fetch columns: a:7 b:8 c:9 d:10 ├── update-mapping: - │ ├── column15:15 => a:1 - │ ├── column16:16 => b:2 - │ └── column18:18 => d:4 + │ ├── a_cast:15 => a:1 + │ ├── b_cast:16 => b:2 + │ └── d_cast:18 => d:4 ├── check columns: check1:19 check2:20 └── project - ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16 column18:18 + ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16 d_cast:18 ├── project - │ ├── columns: column18:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16 + │ ├── columns: d_cast:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16 │ ├── project - │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16 + │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16 │ │ ├── project - │ │ │ ├── columns: column15:15!null column16:16 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 + │ │ │ ├── columns: a_cast:15!null b_cast:16 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ ├── project │ │ │ │ ├── columns: a_new:13!null b_new:14 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ │ ├── scan decimals @@ -1950,18 +1950,18 @@ update decimals │ │ │ │ ├── 1.1 [as=a_new:13] │ │ │ │ └── ARRAY[0.95, NULL, 15::DECIMAL(10,2)] [as=b_new:14] │ │ │ └── projections - │ │ │ ├── assignment-cast: DECIMAL(10) [as=column15:15] + │ │ │ ├── assignment-cast: DECIMAL(10) [as=a_cast:15] │ │ │ │ └── a_new:13 - │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=column16:16] + │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=b_cast:16] │ │ │ └── b_new:14 │ │ └── projections - │ │ └── column15:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] + │ │ └── a_cast:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column18:18] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:18] │ └── d_comp:17 └── projections - ├── round(column15:15) = column15:15 [as=check1:19] - └── column16:16[0] > 1 [as=check2:20] + ├── round(a_cast:15) = a_cast:15 [as=check1:19] + └── b_cast:16[0] > 1 [as=check2:20] # Test tuple-syntax prepared update with assignment casts required. assign-placeholders-build query-args=(1.1, (ARRAY[0.95, NULL, 15::DECIMAL(10, 2)])) @@ -1971,18 +1971,18 @@ update decimals ├── columns: ├── fetch columns: a:7 b:8 c:9 d:10 ├── update-mapping: - │ ├── column15:15 => a:1 - │ ├── column16:16 => b:2 - │ └── column18:18 => d:4 + │ ├── a_cast:15 => a:1 + │ ├── b_cast:16 => b:2 + │ └── d_cast:18 => d:4 ├── check columns: check1:19 check2:20 └── project - ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16!null column18:18 + ├── columns: check1:19 check2:20 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16!null d_cast:18 ├── project - │ ├── columns: column18:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16!null + │ ├── columns: d_cast:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16!null │ ├── project - │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column15:15!null column16:16!null + │ │ ├── columns: d_comp:17 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:15!null b_cast:16!null │ │ ├── project - │ │ │ ├── columns: column15:15!null column16:16!null a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 + │ │ │ ├── columns: a_cast:15!null b_cast:16!null a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ ├── project │ │ │ │ ├── columns: a_new:13!null b_new:14!null a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ │ ├── scan decimals @@ -1994,18 +1994,18 @@ update decimals │ │ │ │ ├── 1.1 [as=a_new:13] │ │ │ │ └── ARRAY[0.95,NULL,15.00] [as=b_new:14] │ │ │ └── projections - │ │ │ ├── assignment-cast: DECIMAL(10) [as=column15:15] + │ │ │ ├── assignment-cast: DECIMAL(10) [as=a_cast:15] │ │ │ │ └── a_new:13 - │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=column16:16] + │ │ │ └── assignment-cast: DECIMAL(5,1)[] [as=b_cast:16] │ │ │ └── b_new:14 │ │ └── projections - │ │ └── column15:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] + │ │ └── a_cast:15::DECIMAL + c:9::DECIMAL [as=d_comp:17] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column18:18] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:18] │ └── d_comp:17 └── projections - ├── round(column15:15) = column15:15 [as=check1:19] - └── column16:16[0] > 1 [as=check2:20] + ├── round(a_cast:15) = a_cast:15 [as=check1:19] + └── b_cast:16[0] > 1 [as=check2:20] # Test tuple-syntax update with DEFAULT that requires assignment cast. build @@ -2015,12 +2015,12 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16 ├── update-mapping: - │ ├── column21:21 => c:1 - │ └── column22:22 => i:3 + │ ├── c_cast:21 => c:1 + │ └── i_cast:22 => i:3 └── project - ├── columns: d_comp_comp:23 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 column21:21!null column22:22!null + ├── columns: d_comp_comp:23 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 c_cast:21!null i_cast:22!null ├── project - │ ├── columns: column21:21!null column22:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 + │ ├── columns: c_cast:21!null i_cast:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ ├── project │ │ ├── columns: c_new:19!null i_new:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ ├── scan assn_cast @@ -2032,9 +2032,9 @@ update assn_cast │ │ ├── ' ' [as=c_new:19] │ │ └── 10::INT2 [as=i_new:20] │ └── projections - │ ├── assignment-cast: CHAR [as=column21:21] + │ ├── assignment-cast: CHAR [as=c_cast:21] │ │ └── c_new:19 - │ └── assignment-cast: INT8 [as=column22:22] + │ └── assignment-cast: INT8 [as=i_cast:22] │ └── i_new:20 └── projections └── d:14::DECIMAL + 10.0 [as=d_comp_comp:23] @@ -2047,12 +2047,12 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16 ├── update-mapping: - │ ├── column21:21 => c:1 - │ └── column22:22 => i:3 + │ ├── c_cast:21 => c:1 + │ └── i_cast:22 => i:3 └── project - ├── columns: d_comp_comp:23 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 column21:21!null column22:22!null + ├── columns: d_comp_comp:23 c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 c_cast:21!null i_cast:22!null ├── project - │ ├── columns: column21:21!null column22:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 + │ ├── columns: c_cast:21!null i_cast:22!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ ├── project │ │ ├── columns: c_new:19!null i_new:20!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 rowid:16!null crdb_internal_mvcc_timestamp:17 tableoid:18 │ │ ├── scan assn_cast @@ -2064,9 +2064,9 @@ update assn_cast │ │ ├── ' ' [as=c_new:19] │ │ └── 10::INT2 [as=i_new:20] │ └── projections - │ ├── assignment-cast: CHAR [as=column21:21] + │ ├── assignment-cast: CHAR [as=c_cast:21] │ │ └── c_new:19 - │ └── assignment-cast: INT8 [as=column22:22] + │ └── assignment-cast: INT8 [as=i_cast:22] │ └── i_new:20 └── projections └── d:14::DECIMAL + 10.0 [as=d_comp_comp:23] @@ -2079,17 +2079,17 @@ update decimals ├── columns: ├── fetch columns: a:7 b:8 c:9 d:10 ├── update-mapping: - │ ├── column14:14 => a:1 - │ └── column16:16 => d:4 + │ ├── a_cast:14 => a:1 + │ └── d_cast:16 => d:4 ├── check columns: check1:17 └── project - ├── columns: check1:17 check2:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column14:14 column16:16 + ├── columns: check1:17 check2:18 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:14 d_cast:16 ├── project - │ ├── columns: column16:16 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column14:14 + │ ├── columns: d_cast:16 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:14 │ ├── project - │ │ ├── columns: d_comp:15 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 column14:14 + │ │ ├── columns: d_comp:15 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 a_cast:14 │ │ ├── project - │ │ │ ├── columns: column14:14 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 + │ │ │ ├── columns: a_cast:14 a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 │ │ │ ├── left-join-apply │ │ │ │ ├── columns: a:7!null b:8 c:9 d:10 crdb_internal_mvcc_timestamp:11 tableoid:12 n:13 │ │ │ │ ├── scan decimals @@ -2107,15 +2107,15 @@ update decimals │ │ │ │ │ └── 1.45 [as=n:13] │ │ │ │ └── filters (true) │ │ │ └── projections - │ │ │ └── assignment-cast: DECIMAL(10) [as=column14:14] + │ │ │ └── assignment-cast: DECIMAL(10) [as=a_cast:14] │ │ │ └── n:13 │ │ └── projections - │ │ └── column14:14::DECIMAL + c:9::DECIMAL [as=d_comp:15] + │ │ └── a_cast:14::DECIMAL + c:9::DECIMAL [as=d_comp:15] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column16:16] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:16] │ └── d_comp:15 └── projections - ├── round(column14:14) = column14:14 [as=check1:17] + ├── round(a_cast:14) = a_cast:14 [as=check1:17] └── b:8[0] > 1 [as=check2:18] # Test update with a multi-column subquery that requires assignment casts. @@ -2126,18 +2126,18 @@ update decimals ├── columns: ├── fetch columns: a:7 b:8 c:9 d:10 ├── update-mapping: - │ ├── column19:19 => a:1 - │ ├── column20:20 => c:3 - │ └── column22:22 => d:4 + │ ├── a_cast:19 => a:1 + │ ├── c_cast:20 => c:3 + │ └── d_cast:22 => d:4 ├── check columns: check1:23 └── project - ├── columns: check1:23 check2:24 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 column19:19 column20:20 column22:22 + ├── columns: check1:23 check2:24 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 a_cast:19 c_cast:20 d_cast:22 ├── project - │ ├── columns: column22:22 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 column19:19 column20:20 + │ ├── columns: d_cast:22 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 a_cast:19 c_cast:20 │ ├── project - │ │ ├── columns: d_comp:21 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 column19:19 column20:20 + │ │ ├── columns: d_comp:21 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 a_cast:19 c_cast:20 │ │ ├── project - │ │ │ ├── columns: column19:19 column20:20 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 + │ │ │ ├── columns: a_cast:19 c_cast:20 a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 │ │ │ ├── left-join-apply │ │ │ │ ├── columns: a:7!null b:8 c:9 d:10 decimals.crdb_internal_mvcc_timestamp:11 decimals.tableoid:12 u:13 "?column?":18 │ │ │ │ ├── scan decimals @@ -2159,17 +2159,17 @@ update decimals │ │ │ │ │ └── u:13 * 10.0 [as="?column?":18] │ │ │ │ └── filters (true) │ │ │ └── projections - │ │ │ ├── assignment-cast: DECIMAL(10) [as=column19:19] + │ │ │ ├── assignment-cast: DECIMAL(10) [as=a_cast:19] │ │ │ │ └── u:13 - │ │ │ └── assignment-cast: DECIMAL(10,1) [as=column20:20] + │ │ │ └── assignment-cast: DECIMAL(10,1) [as=c_cast:20] │ │ │ └── "?column?":18 │ │ └── projections - │ │ └── column19:19::DECIMAL + column20:20::DECIMAL [as=d_comp:21] + │ │ └── a_cast:19::DECIMAL + c_cast:20::DECIMAL [as=d_comp:21] │ └── projections - │ └── assignment-cast: DECIMAL(10,1) [as=column22:22] + │ └── assignment-cast: DECIMAL(10,1) [as=d_cast:22] │ └── d_comp:21 └── projections - ├── round(column19:19) = column19:19 [as=check1:23] + ├── round(a_cast:19) = a_cast:19 [as=check1:23] └── b:8[0] > 1 [as=check2:24] # Test combined standard and subquery update the requires assignment casts. @@ -2180,13 +2180,13 @@ update assn_cast ├── columns: ├── fetch columns: c:10 qc:11 i:12 s:13 d:14 d_comp:15 assn_cast.rowid:16 ├── update-mapping: - │ ├── column27:27 => c:1 - │ ├── column28:28 => qc:2 + │ ├── c_cast:27 => c:1 + │ ├── qc_cast:28 => qc:2 │ └── "?column?":25 => i:3 └── project - ├── columns: d_comp_comp:29 c:10 qc:11 i:12 s:13 d:14 d_comp:15 assn_cast.rowid:16!null assn_cast.crdb_internal_mvcc_timestamp:17 assn_cast.tableoid:18 "?column?":25 column27:27!null column28:28 + ├── columns: d_comp_comp:29 c:10 qc:11 i:12 s:13 d:14 d_comp:15 assn_cast.rowid:16!null assn_cast.crdb_internal_mvcc_timestamp:17 assn_cast.tableoid:18 "?column?":25 c_cast:27!null qc_cast:28 ├── project - │ ├── columns: column27:27!null column28:28 c:10 qc:11 i:12 s:13 d:14 d_comp:15 assn_cast.rowid:16!null assn_cast.crdb_internal_mvcc_timestamp:17 assn_cast.tableoid:18 "?column?":25 + │ ├── columns: c_cast:27!null qc_cast:28 c:10 qc:11 i:12 s:13 d:14 d_comp:15 assn_cast.rowid:16!null assn_cast.crdb_internal_mvcc_timestamp:17 assn_cast.tableoid:18 "?column?":25 │ ├── project │ │ ├── columns: c_new:26!null c:10 qc:11 i:12 s:13 d:14 d_comp:15 assn_cast.rowid:16!null assn_cast.crdb_internal_mvcc_timestamp:17 assn_cast.tableoid:18 "?column?":24 "?column?":25 │ │ ├── left-join-apply @@ -2209,9 +2209,9 @@ update assn_cast │ │ └── projections │ │ └── ' ' [as=c_new:26] │ └── projections - │ ├── assignment-cast: CHAR [as=column27:27] + │ ├── assignment-cast: CHAR [as=c_cast:27] │ │ └── c_new:26 - │ └── assignment-cast: "char" [as=column28:28] + │ └── assignment-cast: "char" [as=qc_cast:28] │ └── "?column?":24 └── projections └── d:14::DECIMAL + 10.0 [as=d_comp_comp:29] @@ -2225,13 +2225,13 @@ update assn_cast_on_update ├── fetch columns: i:8 d:9 d2:10 d_comp:11 rowid:12 ├── update-mapping: │ ├── i_new:15 => i:1 - │ ├── column18:18 => d:2 - │ ├── column19:19 => d2:3 - │ └── column20:20 => d_comp:4 + │ ├── d_cast:18 => d:2 + │ ├── d2_cast:19 => d2:3 + │ └── d_comp_cast:20 => d_comp:4 └── project - ├── columns: column20:20!null i:8 d:9 d2:10 d_comp:11 rowid:12!null crdb_internal_mvcc_timestamp:13 tableoid:14 i_new:15!null column18:18!null column19:19!null + ├── columns: d_comp_cast:20!null i:8 d:9 d2:10 d_comp:11 rowid:12!null crdb_internal_mvcc_timestamp:13 tableoid:14 i_new:15!null d_cast:18!null d2_cast:19!null ├── project - │ ├── columns: column18:18!null column19:19!null i:8 d:9 d2:10 d_comp:11 rowid:12!null crdb_internal_mvcc_timestamp:13 tableoid:14 i_new:15!null + │ ├── columns: d_cast:18!null d2_cast:19!null i:8 d:9 d2:10 d_comp:11 rowid:12!null crdb_internal_mvcc_timestamp:13 tableoid:14 i_new:15!null │ ├── project │ │ ├── columns: d_on_update:16!null d2_on_update:17!null i:8 d:9 d2:10 d_comp:11 rowid:12!null crdb_internal_mvcc_timestamp:13 tableoid:14 i_new:15!null │ │ ├── project @@ -2247,13 +2247,13 @@ update assn_cast_on_update │ │ ├── 1.23 [as=d_on_update:16] │ │ └── 1.23::DECIMAL(10,2) [as=d2_on_update:17] │ └── projections - │ ├── assignment-cast: DECIMAL(10,1) [as=column18:18] + │ ├── assignment-cast: DECIMAL(10,1) [as=d_cast:18] │ │ └── d_on_update:16 - │ └── assignment-cast: DECIMAL(10,1) [as=column19:19] + │ └── assignment-cast: DECIMAL(10,1) [as=d2_cast:19] │ └── d2_on_update:17 └── projections - └── assignment-cast: DECIMAL(10) [as=column20:20] - └── column18:18 + └── assignment-cast: DECIMAL(10) [as=d_comp_cast:20] + └── d_cast:18 # ------------------------------------------------------------------------------ # ON UPDATE tests. diff --git a/pkg/sql/opt/optbuilder/testdata/update-col-cast-bug b/pkg/sql/opt/optbuilder/testdata/update-col-cast-bug index 41e2cba597a2..44b45ee90c95 100644 --- a/pkg/sql/opt/optbuilder/testdata/update-col-cast-bug +++ b/pkg/sql/opt/optbuilder/testdata/update-col-cast-bug @@ -17,9 +17,9 @@ with &1 (cte) ├── fetch columns: a:7(int2) b:8(int2) t.c:9(int2) rowid:10(int) ├── update-mapping: │ ├── a_new:16 => a:1 - │ └── column18:18 => t.c:3 + │ └── c_cast:18 => t.c:3 └── project - ├── columns: column18:18(int2) a:7(int2) b:8(int2) t.c:9(int2) rowid:10(int!null) crdb_internal_mvcc_timestamp:11(decimal) tableoid:12(oid) a_new:16(int2) + ├── columns: c_cast:18(int2) a:7(int2) b:8(int2) t.c:9(int2) rowid:10(int!null) crdb_internal_mvcc_timestamp:11(decimal) tableoid:12(oid) a_new:16(int2) ├── project │ ├── columns: c_comp:17(int) a:7(int2) b:8(int2) t.c:9(int2) rowid:10(int!null) crdb_internal_mvcc_timestamp:11(decimal) tableoid:12(oid) a_new:16(int2) │ ├── project @@ -53,5 +53,5 @@ with &1 (cte) │ └── projections │ └── a_new:16::INT8 + b:8::INT8 [as=c_comp:17, type=int] └── projections - └── assignment-cast: INT2 [as=column18:18, type=int2] + └── assignment-cast: INT2 [as=c_cast:18, type=int2] └── c_comp:17 [type=int] diff --git a/pkg/sql/opt/optbuilder/testdata/update_from b/pkg/sql/opt/optbuilder/testdata/update_from index 43652b45fdb7..624ab9fff587 100644 --- a/pkg/sql/opt/optbuilder/testdata/update_from +++ b/pkg/sql/opt/optbuilder/testdata/update_from @@ -368,9 +368,9 @@ update abc ├── columns: ├── fetch columns: a:6 b:7 c:8 ├── update-mapping: - │ └── column15:15 => b:2 + │ └── b_cast:15 => b:2 └── project - ├── columns: column15:15 a:6!null b:7 c:8 k:11!null d:12 other.crdb_internal_mvcc_timestamp:13 other.tableoid:14 + ├── columns: b_cast:15 a:6!null b:7 c:8 k:11!null d:12 other.crdb_internal_mvcc_timestamp:13 other.tableoid:14 ├── inner-join (merge) │ ├── columns: a:6!null b:7 c:8 k:11!null d:12 other.crdb_internal_mvcc_timestamp:13 other.tableoid:14 │ ├── left ordering: +6 @@ -383,7 +383,7 @@ update abc │ │ └── ordering: +11 │ └── filters (true) └── projections - └── assignment-cast: INT8 [as=column15:15] + └── assignment-cast: INT8 [as=b_cast:15] └── d:12 # Regression test for #61520. The new value for column a should be in-scope when @@ -406,12 +406,12 @@ project ├── columns: a:1!null rowid:2!null column1:9 ├── fetch columns: a:5 rowid:6 ├── update-mapping: - │ └── column10:10 => a:1 + │ └── a_cast:10 => a:1 ├── check columns: check1:11 └── project - ├── columns: check1:11!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null column10:10!null + ├── columns: check1:11!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null a_cast:10!null ├── project - │ ├── columns: column10:10!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null + │ ├── columns: a_cast:10!null a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null │ ├── select │ │ ├── columns: a:5!null rowid:6!null crdb_internal_mvcc_timestamp:7 tableoid:8 column1:9!null │ │ ├── inner-join (cross) @@ -425,7 +425,7 @@ project │ │ └── filters │ │ └── a:5 = column1:9 │ └── projections - │ └── assignment-cast: DECIMAL(10,2) [as=column10:10] + │ └── assignment-cast: DECIMAL(10,2) [as=a_cast:10] │ └── column1:9 └── projections - └── column10:10 > 0 [as=check1:11] + └── a_cast:10 > 0 [as=check1:11] diff --git a/pkg/sql/opt/xform/testdata/external/tpcc b/pkg/sql/opt/xform/testdata/external/tpcc index c1ace1e23f6f..251db3b85fa0 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc +++ b/pkg/sql/opt/xform/testdata/external/tpcc @@ -366,17 +366,17 @@ insert order_line │ ├── column6:18 => order_line.ol_supply_w_id:6 │ ├── ol_delivery_d_default:24 => ol_delivery_d:7 │ ├── column7:19 => ol_quantity:8 - │ ├── column22:22 => ol_amount:9 - │ └── column23:23 => ol_dist_info:10 + │ ├── ol_amount_cast:22 => ol_amount:9 + │ └── ol_dist_info_cast:23 => ol_dist_info:10 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: ol_delivery_d_default:24 column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null column22:22!null column23:23!null + │ ├── columns: ol_delivery_d_default:24 column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null │ ├── cardinality: [6 - 6] │ ├── fd: ()-->(24) │ ├── values - │ │ ├── columns: column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null column22:22!null column23:23!null + │ │ ├── columns: column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null │ │ ├── cardinality: [6 - 6] │ │ ├── (3045, 2, 10, 3, 648, 0, 9, 394.47, 'YhgLRrwsmd68P2bElAgrnp8u') │ │ ├── (3045, 2, 10, 5, 25393, 0, 10, 830.60, 'dLXe0YhgLRrwsmd68P2bElAg') @@ -438,13 +438,13 @@ project ├── columns: w_id:1!null w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 ├── fetch columns: w_id:12 w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 ├── update-mapping: - │ └── column24:24 => w_ytd:9 + │ └── w_ytd_cast:24 => w_ytd:9 ├── cardinality: [0 - 1] ├── volatile, mutations ├── key: () ├── fd: ()-->(1-7) └── project - ├── columns: column24:24 w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 + ├── columns: w_ytd_cast:24 w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -456,7 +456,7 @@ project │ ├── key: () │ └── fd: ()-->(12-20) └── projections - └── assignment-cast: DECIMAL(12,2) [as=column24:24, outer=(20), immutable] + └── assignment-cast: DECIMAL(12,2) [as=w_ytd_cast:24, outer=(20), immutable] └── w_ytd:20::DECIMAL + 3860.61 opt format=hide-qual @@ -473,13 +473,13 @@ project ├── columns: d_id:1!null d_w_id:2!null d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 ├── fetch columns: d_id:14 d_w_id:15 d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 ├── update-mapping: - │ └── column28:28 => d_ytd:10 + │ └── d_ytd_cast:28 => d_ytd:10 ├── cardinality: [0 - 1] ├── volatile, mutations ├── key: () ├── fd: ()-->(1-8) └── project - ├── columns: column28:28 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + ├── columns: d_ytd_cast:28 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -491,7 +491,7 @@ project │ ├── key: () │ └── fd: ()-->(14-24) └── projections - └── assignment-cast: DECIMAL(12,2) [as=column28:28, outer=(23), immutable] + └── assignment-cast: DECIMAL(12,2) [as=d_ytd_cast:28, outer=(23), immutable] └── d_ytd:23::DECIMAL + 3860.61 opt format=hide-qual @@ -563,16 +563,16 @@ project │ ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 c_data:21 │ ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 │ ├── update-mapping: - │ │ ├── column51:51 => c_balance:17 - │ │ ├── column52:52 => c_ytd_payment:18 + │ │ ├── c_balance_cast:51 => c_balance:17 + │ │ ├── c_ytd_payment_cast:52 => c_ytd_payment:18 │ │ ├── c_payment_cnt_new:49 => c_payment_cnt:19 - │ │ └── column53:53 => c_data:21 + │ │ └── c_data_cast:53 => c_data:21 │ ├── cardinality: [0 - 1] │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1-17,21) │ └── project - │ ├── columns: column51:51 column52:52 column53:53 c_payment_cnt_new:49 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + │ ├── columns: c_balance_cast:51 c_ytd_payment_cast:52 c_data_cast:53 c_payment_cnt_new:49 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 │ ├── cardinality: [0 - 1] │ ├── immutable │ ├── key: () @@ -584,11 +584,11 @@ project │ │ ├── key: () │ │ └── fd: ()-->(24-44) │ └── projections - │ ├── assignment-cast: DECIMAL(12,2) [as=column51:51, outer=(40), immutable] + │ ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:51, outer=(40), immutable] │ │ └── c_balance:40::DECIMAL - 3860.61 - │ ├── assignment-cast: DECIMAL(12,2) [as=column52:52, outer=(41), immutable] + │ ├── assignment-cast: DECIMAL(12,2) [as=c_ytd_payment_cast:52, outer=(41), immutable] │ │ └── c_ytd_payment:41::DECIMAL + 3860.61 - │ ├── assignment-cast: VARCHAR(500) [as=column53:53, outer=(24-26,37,44), immutable] + │ ├── assignment-cast: VARCHAR(500) [as=c_data_cast:53, outer=(24-26,37,44), immutable] │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44::STRING, 500) ELSE c_data:44::STRING END │ └── c_payment_cnt:42 + 1 [as=c_payment_cnt_new:49, outer=(42), immutable] └── projections @@ -610,13 +610,13 @@ insert history │ ├── column4:15 => history.h_d_id:5 │ ├── column5:16 => history.h_w_id:6 │ ├── column7:18 => h_date:7 - │ ├── column20:20 => h_amount:8 - │ └── column21:21 => h_data:9 + │ ├── h_amount_cast:20 => h_amount:8 + │ └── h_data_cast:21 => h_data:9 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── values - │ ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column7:18!null column20:20!null column21:21!null rowid_default:22 + │ ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column7:18!null h_amount_cast:20!null h_data_cast:21!null rowid_default:22 │ ├── cardinality: [1 - 1] │ ├── volatile │ ├── key: () @@ -882,12 +882,12 @@ update customer ├── columns: ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 ├── update-mapping: - │ ├── column49:49 => c_balance:17 + │ ├── c_balance_cast:49 => c_balance:17 │ └── c_delivery_cnt_new:47 => c_delivery_cnt:20 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column49:49 c_delivery_cnt_new:47 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + ├── columns: c_balance_cast:49 c_delivery_cnt_new:47 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 ├── cardinality: [0 - 10] ├── immutable ├── key: (24,25) @@ -909,7 +909,7 @@ update customer │ ├── key: (24,25) │ └── fd: ()-->(26), (24,25)-->(27-44) └── projections - ├── assignment-cast: DECIMAL(12,2) [as=column49:49, outer=(25,40), immutable] + ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:49, outer=(25,40), immutable] │ └── c_balance:40::DECIMAL + CASE c_d_id:25 WHEN 6 THEN 57214.780000 WHEN 8 THEN 67755.430000 WHEN 1 THEN 51177.840000 WHEN 2 THEN 73840.700000 WHEN 4 THEN 45906.990000 WHEN 9 THEN 32523.760000 WHEN 10 THEN 20240.200000 WHEN 3 THEN 75299.790000 WHEN 5 THEN 56543.340000 WHEN 7 THEN 67157.940000 ELSE CAST(NULL AS DECIMAL) END └── c_delivery_cnt:43 + 1 [as=c_delivery_cnt_new:47, outer=(43), immutable] diff --git a/pkg/sql/opt/xform/testdata/external/tpcc-later-stats b/pkg/sql/opt/xform/testdata/external/tpcc-later-stats index 687a8adfdc4d..c56154b03ebd 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc-later-stats +++ b/pkg/sql/opt/xform/testdata/external/tpcc-later-stats @@ -369,17 +369,17 @@ insert order_line │ ├── column6:18 => order_line.ol_supply_w_id:6 │ ├── ol_delivery_d_default:24 => ol_delivery_d:7 │ ├── column7:19 => ol_quantity:8 - │ ├── column22:22 => ol_amount:9 - │ └── column23:23 => ol_dist_info:10 + │ ├── ol_amount_cast:22 => ol_amount:9 + │ └── ol_dist_info_cast:23 => ol_dist_info:10 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: ol_delivery_d_default:24 column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null column22:22!null column23:23!null + │ ├── columns: ol_delivery_d_default:24 column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null │ ├── cardinality: [6 - 6] │ ├── fd: ()-->(24) │ ├── values - │ │ ├── columns: column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null column22:22!null column23:23!null + │ │ ├── columns: column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null │ │ ├── cardinality: [6 - 6] │ │ ├── (3045, 2, 10, 3, 648, 0, 9, 394.47, 'YhgLRrwsmd68P2bElAgrnp8u') │ │ ├── (3045, 2, 10, 5, 25393, 0, 10, 830.60, 'dLXe0YhgLRrwsmd68P2bElAg') @@ -441,13 +441,13 @@ project ├── columns: w_id:1!null w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 ├── fetch columns: w_id:12 w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 ├── update-mapping: - │ └── column24:24 => w_ytd:9 + │ └── w_ytd_cast:24 => w_ytd:9 ├── cardinality: [0 - 1] ├── volatile, mutations ├── key: () ├── fd: ()-->(1-7) └── project - ├── columns: column24:24 w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 + ├── columns: w_ytd_cast:24 w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -459,7 +459,7 @@ project │ ├── key: () │ └── fd: ()-->(12-20) └── projections - └── assignment-cast: DECIMAL(12,2) [as=column24:24, outer=(20), immutable] + └── assignment-cast: DECIMAL(12,2) [as=w_ytd_cast:24, outer=(20), immutable] └── w_ytd:20::DECIMAL + 3860.61 opt format=hide-qual @@ -476,13 +476,13 @@ project ├── columns: d_id:1!null d_w_id:2!null d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 ├── fetch columns: d_id:14 d_w_id:15 d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 ├── update-mapping: - │ └── column28:28 => d_ytd:10 + │ └── d_ytd_cast:28 => d_ytd:10 ├── cardinality: [0 - 1] ├── volatile, mutations ├── key: () ├── fd: ()-->(1-8) └── project - ├── columns: column28:28 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + ├── columns: d_ytd_cast:28 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -494,7 +494,7 @@ project │ ├── key: () │ └── fd: ()-->(14-24) └── projections - └── assignment-cast: DECIMAL(12,2) [as=column28:28, outer=(23), immutable] + └── assignment-cast: DECIMAL(12,2) [as=d_ytd_cast:28, outer=(23), immutable] └── d_ytd:23::DECIMAL + 3860.61 opt format=hide-qual @@ -566,16 +566,16 @@ project │ ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 c_data:21 │ ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 │ ├── update-mapping: - │ │ ├── column51:51 => c_balance:17 - │ │ ├── column52:52 => c_ytd_payment:18 + │ │ ├── c_balance_cast:51 => c_balance:17 + │ │ ├── c_ytd_payment_cast:52 => c_ytd_payment:18 │ │ ├── c_payment_cnt_new:49 => c_payment_cnt:19 - │ │ └── column53:53 => c_data:21 + │ │ └── c_data_cast:53 => c_data:21 │ ├── cardinality: [0 - 1] │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1-17,21) │ └── project - │ ├── columns: column51:51 column52:52 column53:53 c_payment_cnt_new:49 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + │ ├── columns: c_balance_cast:51 c_ytd_payment_cast:52 c_data_cast:53 c_payment_cnt_new:49 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 │ ├── cardinality: [0 - 1] │ ├── immutable │ ├── key: () @@ -587,11 +587,11 @@ project │ │ ├── key: () │ │ └── fd: ()-->(24-44) │ └── projections - │ ├── assignment-cast: DECIMAL(12,2) [as=column51:51, outer=(40), immutable] + │ ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:51, outer=(40), immutable] │ │ └── c_balance:40::DECIMAL - 3860.61 - │ ├── assignment-cast: DECIMAL(12,2) [as=column52:52, outer=(41), immutable] + │ ├── assignment-cast: DECIMAL(12,2) [as=c_ytd_payment_cast:52, outer=(41), immutable] │ │ └── c_ytd_payment:41::DECIMAL + 3860.61 - │ ├── assignment-cast: VARCHAR(500) [as=column53:53, outer=(24-26,37,44), immutable] + │ ├── assignment-cast: VARCHAR(500) [as=c_data_cast:53, outer=(24-26,37,44), immutable] │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44::STRING, 500) ELSE c_data:44::STRING END │ └── c_payment_cnt:42 + 1 [as=c_payment_cnt_new:49, outer=(42), immutable] └── projections @@ -613,13 +613,13 @@ insert history │ ├── column4:15 => history.h_d_id:5 │ ├── column5:16 => history.h_w_id:6 │ ├── column7:18 => h_date:7 - │ ├── column20:20 => h_amount:8 - │ └── column21:21 => h_data:9 + │ ├── h_amount_cast:20 => h_amount:8 + │ └── h_data_cast:21 => h_data:9 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── values - │ ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column7:18!null column20:20!null column21:21!null rowid_default:22 + │ ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column7:18!null h_amount_cast:20!null h_data_cast:21!null rowid_default:22 │ ├── cardinality: [1 - 1] │ ├── volatile │ ├── key: () @@ -885,12 +885,12 @@ update customer ├── columns: ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 ├── update-mapping: - │ ├── column49:49 => c_balance:17 + │ ├── c_balance_cast:49 => c_balance:17 │ └── c_delivery_cnt_new:47 => c_delivery_cnt:20 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column49:49 c_delivery_cnt_new:47 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + ├── columns: c_balance_cast:49 c_delivery_cnt_new:47 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 ├── cardinality: [0 - 10] ├── immutable ├── key: (24,25) @@ -912,7 +912,7 @@ update customer │ ├── key: (24,25) │ └── fd: ()-->(26), (24,25)-->(27-44) └── projections - ├── assignment-cast: DECIMAL(12,2) [as=column49:49, outer=(25,40), immutable] + ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:49, outer=(25,40), immutable] │ └── c_balance:40::DECIMAL + CASE c_d_id:25 WHEN 6 THEN 57214.780000 WHEN 8 THEN 67755.430000 WHEN 1 THEN 51177.840000 WHEN 2 THEN 73840.700000 WHEN 4 THEN 45906.990000 WHEN 9 THEN 32523.760000 WHEN 10 THEN 20240.200000 WHEN 3 THEN 75299.790000 WHEN 5 THEN 56543.340000 WHEN 7 THEN 67157.940000 ELSE CAST(NULL AS DECIMAL) END └── c_delivery_cnt:43 + 1 [as=c_delivery_cnt_new:47, outer=(43), immutable] diff --git a/pkg/sql/opt/xform/testdata/external/tpcc-no-stats b/pkg/sql/opt/xform/testdata/external/tpcc-no-stats index 1e9e5dd53d77..00d138f8cb22 100644 --- a/pkg/sql/opt/xform/testdata/external/tpcc-no-stats +++ b/pkg/sql/opt/xform/testdata/external/tpcc-no-stats @@ -363,17 +363,17 @@ insert order_line │ ├── column6:18 => order_line.ol_supply_w_id:6 │ ├── ol_delivery_d_default:24 => ol_delivery_d:7 │ ├── column7:19 => ol_quantity:8 - │ ├── column22:22 => ol_amount:9 - │ └── column23:23 => ol_dist_info:10 + │ ├── ol_amount_cast:22 => ol_amount:9 + │ └── ol_dist_info_cast:23 => ol_dist_info:10 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: ol_delivery_d_default:24 column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null column22:22!null column23:23!null + │ ├── columns: ol_delivery_d_default:24 column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null │ ├── cardinality: [6 - 6] │ ├── fd: ()-->(24) │ ├── values - │ │ ├── columns: column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null column22:22!null column23:23!null + │ │ ├── columns: column1:13!null column2:14!null column3:15!null column4:16!null column5:17!null column6:18!null column7:19!null ol_amount_cast:22!null ol_dist_info_cast:23!null │ │ ├── cardinality: [6 - 6] │ │ ├── (3045, 2, 10, 3, 648, 0, 9, 394.47, 'YhgLRrwsmd68P2bElAgrnp8u') │ │ ├── (3045, 2, 10, 5, 25393, 0, 10, 830.60, 'dLXe0YhgLRrwsmd68P2bElAg') @@ -435,13 +435,13 @@ project ├── columns: w_id:1!null w_name:2 w_street_1:3 w_street_2:4 w_city:5 w_state:6 w_zip:7 ├── fetch columns: w_id:12 w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 ├── update-mapping: - │ └── column24:24 => w_ytd:9 + │ └── w_ytd_cast:24 => w_ytd:9 ├── cardinality: [0 - 1] ├── volatile, mutations ├── key: () ├── fd: ()-->(1-7) └── project - ├── columns: column24:24 w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 + ├── columns: w_ytd_cast:24 w_id:12!null w_name:13 w_street_1:14 w_street_2:15 w_city:16 w_state:17 w_zip:18 w_tax:19 w_ytd:20 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -453,7 +453,7 @@ project │ ├── key: () │ └── fd: ()-->(12-20) └── projections - └── assignment-cast: DECIMAL(12,2) [as=column24:24, outer=(20), immutable] + └── assignment-cast: DECIMAL(12,2) [as=w_ytd_cast:24, outer=(20), immutable] └── w_ytd:20::DECIMAL + 3860.61 opt format=hide-qual @@ -470,13 +470,13 @@ project ├── columns: d_id:1!null d_w_id:2!null d_name:3 d_street_1:4 d_street_2:5 d_city:6 d_state:7 d_zip:8 ├── fetch columns: d_id:14 d_w_id:15 d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 ├── update-mapping: - │ └── column28:28 => d_ytd:10 + │ └── d_ytd_cast:28 => d_ytd:10 ├── cardinality: [0 - 1] ├── volatile, mutations ├── key: () ├── fd: ()-->(1-8) └── project - ├── columns: column28:28 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 + ├── columns: d_ytd_cast:28 d_id:14!null d_w_id:15!null d_name:16 d_street_1:17 d_street_2:18 d_city:19 d_state:20 d_zip:21 d_tax:22 d_ytd:23 d_next_o_id:24 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -488,7 +488,7 @@ project │ ├── key: () │ └── fd: ()-->(14-24) └── projections - └── assignment-cast: DECIMAL(12,2) [as=column28:28, outer=(23), immutable] + └── assignment-cast: DECIMAL(12,2) [as=d_ytd_cast:28, outer=(23), immutable] └── d_ytd:23::DECIMAL + 3860.61 opt format=hide-qual @@ -560,16 +560,16 @@ project │ ├── columns: c_id:1!null c_d_id:2!null c_w_id:3!null c_first:4 c_middle:5 c_last:6 c_street_1:7 c_street_2:8 c_city:9 c_state:10 c_zip:11 c_phone:12 c_since:13 c_credit:14 c_credit_lim:15 c_discount:16 c_balance:17 c_data:21 │ ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 │ ├── update-mapping: - │ │ ├── column51:51 => c_balance:17 - │ │ ├── column52:52 => c_ytd_payment:18 + │ │ ├── c_balance_cast:51 => c_balance:17 + │ │ ├── c_ytd_payment_cast:52 => c_ytd_payment:18 │ │ ├── c_payment_cnt_new:49 => c_payment_cnt:19 - │ │ └── column53:53 => c_data:21 + │ │ └── c_data_cast:53 => c_data:21 │ ├── cardinality: [0 - 1] │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1-17,21) │ └── project - │ ├── columns: column51:51 column52:52 column53:53 c_payment_cnt_new:49 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + │ ├── columns: c_balance_cast:51 c_ytd_payment_cast:52 c_data_cast:53 c_payment_cnt_new:49 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 │ ├── cardinality: [0 - 1] │ ├── immutable │ ├── key: () @@ -581,11 +581,11 @@ project │ │ ├── key: () │ │ └── fd: ()-->(24-44) │ └── projections - │ ├── assignment-cast: DECIMAL(12,2) [as=column51:51, outer=(40), immutable] + │ ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:51, outer=(40), immutable] │ │ └── c_balance:40::DECIMAL - 3860.61 - │ ├── assignment-cast: DECIMAL(12,2) [as=column52:52, outer=(41), immutable] + │ ├── assignment-cast: DECIMAL(12,2) [as=c_ytd_payment_cast:52, outer=(41), immutable] │ │ └── c_ytd_payment:41::DECIMAL + 3860.61 - │ ├── assignment-cast: VARCHAR(500) [as=column53:53, outer=(24-26,37,44), immutable] + │ ├── assignment-cast: VARCHAR(500) [as=c_data_cast:53, outer=(24-26,37,44), immutable] │ │ └── CASE c_credit:37 WHEN 'BC' THEN left((((((c_id:24::STRING || c_d_id:25::STRING) || c_w_id:26::STRING) || '5') || '10') || '3860.61') || c_data:44::STRING, 500) ELSE c_data:44::STRING END │ └── c_payment_cnt:42 + 1 [as=c_payment_cnt_new:49, outer=(42), immutable] └── projections @@ -607,13 +607,13 @@ insert history │ ├── column4:15 => history.h_d_id:5 │ ├── column5:16 => history.h_w_id:6 │ ├── column7:18 => h_date:7 - │ ├── column20:20 => h_amount:8 - │ └── column21:21 => h_data:9 + │ ├── h_amount_cast:20 => h_amount:8 + │ └── h_data_cast:21 => h_data:9 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── values - │ ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column7:18!null column20:20!null column21:21!null rowid_default:22 + │ ├── columns: column1:12!null column2:13!null column3:14!null column4:15!null column5:16!null column7:18!null h_amount_cast:20!null h_data_cast:21!null rowid_default:22 │ ├── cardinality: [1 - 1] │ ├── volatile │ ├── key: () @@ -884,12 +884,12 @@ update customer ├── columns: ├── fetch columns: c_id:24 c_d_id:25 c_w_id:26 c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 ├── update-mapping: - │ ├── column49:49 => c_balance:17 + │ ├── c_balance_cast:49 => c_balance:17 │ └── c_delivery_cnt_new:47 => c_delivery_cnt:20 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column49:49 c_delivery_cnt_new:47 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 + ├── columns: c_balance_cast:49 c_delivery_cnt_new:47 c_id:24!null c_d_id:25!null c_w_id:26!null c_first:27 c_middle:28 c_last:29 c_street_1:30 c_street_2:31 c_city:32 c_state:33 c_zip:34 c_phone:35 c_since:36 c_credit:37 c_credit_lim:38 c_discount:39 c_balance:40 c_ytd_payment:41 c_payment_cnt:42 c_delivery_cnt:43 c_data:44 ├── cardinality: [0 - 10] ├── immutable ├── key: (24,25) @@ -911,7 +911,7 @@ update customer │ ├── key: (24,25) │ └── fd: ()-->(26), (24,25)-->(27-44) └── projections - ├── assignment-cast: DECIMAL(12,2) [as=column49:49, outer=(25,40), immutable] + ├── assignment-cast: DECIMAL(12,2) [as=c_balance_cast:49, outer=(25,40), immutable] │ └── c_balance:40::DECIMAL + CASE c_d_id:25 WHEN 6 THEN 57214.780000 WHEN 8 THEN 67755.430000 WHEN 1 THEN 51177.840000 WHEN 2 THEN 73840.700000 WHEN 4 THEN 45906.990000 WHEN 9 THEN 32523.760000 WHEN 10 THEN 20240.200000 WHEN 3 THEN 75299.790000 WHEN 5 THEN 56543.340000 WHEN 7 THEN 67157.940000 ELSE CAST(NULL AS DECIMAL) END └── c_delivery_cnt:43 + 1 [as=c_delivery_cnt_new:47, outer=(43), immutable] diff --git a/pkg/sql/opt/xform/testdata/external/tpce b/pkg/sql/opt/xform/testdata/external/tpce index e13b7368e070..0b17af9fe311 100644 --- a/pkg/sql/opt/xform/testdata/external/tpce +++ b/pkg/sql/opt/xform/testdata/external/tpce @@ -567,14 +567,14 @@ with &2 (update_last_trade) │ │ ├── fetch columns: lt_s_symb:8 lt_dts:9 lt_price:10 lt_open_price:11 lt_vol:12 │ │ ├── update-mapping: │ │ │ ├── lt_dts_new:17 => lt_dts:2 - │ │ │ ├── column18:18 => lt_price:3 + │ │ │ ├── lt_price_cast:18 => lt_price:3 │ │ │ └── lt_vol_new:15 => lt_vol:5 │ │ ├── cardinality: [0 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ └── project - │ │ ├── columns: column18:18!null lt_vol_new:15!null lt_dts_new:17!null lt_s_symb:8!null lt_dts:9!null lt_price:10!null lt_open_price:11!null lt_vol:12!null + │ │ ├── columns: lt_price_cast:18!null lt_vol_new:15!null lt_dts_new:17!null lt_s_symb:8!null lt_dts:9!null lt_price:10!null lt_open_price:11!null lt_vol:12!null │ │ ├── cardinality: [0 - 1] │ │ ├── immutable │ │ ├── key: () @@ -586,7 +586,7 @@ with &2 (update_last_trade) │ │ │ ├── key: () │ │ │ └── fd: ()-->(8-12) │ │ └── projections - │ │ ├── 100.00 [as=column18:18] + │ │ ├── 100.00 [as=lt_price_cast:18] │ │ ├── lt_vol:12 + 10 [as=lt_vol_new:15, outer=(12), immutable] │ │ └── '2020-06-15 22:27:42.148484' [as=lt_dts_new:17] │ └── projections @@ -674,13 +674,13 @@ with &2 (update_last_trade) │ │ ├── insert-mapping: │ │ │ ├── tr_t_id:56 => trade_history.th_t_id:51 │ │ │ ├── timestamp:61 => th_dts:52 - │ │ │ └── column62:62 => trade_history.th_st_id:53 + │ │ │ └── th_st_id_cast:62 => trade_history.th_st_id:53 │ │ ├── input binding: &5 │ │ ├── volatile, mutations │ │ ├── key: (51) │ │ ├── fd: ()-->(53) │ │ ├── project - │ │ │ ├── columns: column62:62!null timestamp:61!null tr_t_id:56!null + │ │ │ ├── columns: th_st_id_cast:62!null timestamp:61!null tr_t_id:56!null │ │ │ ├── key: (56) │ │ │ ├── fd: ()-->(61,62) │ │ │ ├── with-scan &3 (request_list) @@ -689,7 +689,7 @@ with &2 (update_last_trade) │ │ │ │ │ └── trade_request.tr_t_id:20 => tr_t_id:56 │ │ │ │ └── key: (56) │ │ │ └── projections - │ │ │ ├── 'SBMT' [as=column62:62] + │ │ │ ├── 'SBMT' [as=th_st_id_cast:62] │ │ │ └── '2020-06-15 22:27:42.148484' [as=timestamp:61] │ │ └── f-k-checks │ │ ├── f-k-checks-item: trade_history(th_t_id) -> trade(t_id) @@ -713,7 +713,7 @@ with &2 (update_last_trade) │ │ ├── with-scan &5 │ │ │ ├── columns: th_st_id:81!null │ │ │ ├── mapping: - │ │ │ │ └── column62:62 => th_st_id:81 + │ │ │ │ └── th_st_id_cast:62 => th_st_id:81 │ │ │ └── fd: ()-->(81) │ │ └── filters (true) │ └── projections @@ -732,12 +732,12 @@ with &2 (update_last_trade) │ │ ├── fetch columns: t_id:104 t_dts:105 trade.t_st_id:106 t_tt_id:107 t_is_cash:108 t_s_symb:109 t_qty:110 t_bid_price:111 t_ca_id:112 t_exec_name:113 t_trade_price:114 t_chrg:115 t_comm:116 t_lifo:118 │ │ ├── update-mapping: │ │ │ ├── t_dts_new:126 => t_dts:88 - │ │ │ └── column127:127 => trade.t_st_id:89 + │ │ │ └── t_st_id_cast:127 => trade.t_st_id:89 │ │ ├── input binding: &7 │ │ ├── volatile, mutations │ │ ├── key: (87) │ │ ├── project - │ │ │ ├── columns: column127:127!null t_dts_new:126!null t_id:104!null t_dts:105!null trade.t_st_id:106!null t_tt_id:107!null t_is_cash:108!null t_s_symb:109!null t_qty:110!null t_bid_price:111!null t_ca_id:112!null t_exec_name:113!null t_trade_price:114 t_chrg:115!null t_comm:116!null t_lifo:118!null + │ │ │ ├── columns: t_st_id_cast:127!null t_dts_new:126!null t_id:104!null t_dts:105!null trade.t_st_id:106!null t_tt_id:107!null t_is_cash:108!null t_s_symb:109!null t_qty:110!null t_bid_price:111!null t_ca_id:112!null t_exec_name:113!null t_trade_price:114 t_chrg:115!null t_comm:116!null t_lifo:118!null │ │ │ ├── key: (104) │ │ │ ├── fd: ()-->(126,127), (104)-->(105-116,118) │ │ │ ├── project @@ -757,7 +757,7 @@ with &2 (update_last_trade) │ │ │ │ │ └── key: (121) │ │ │ │ └── filters (true) │ │ │ └── projections - │ │ │ ├── 'SBMT' [as=column127:127] + │ │ │ ├── 'SBMT' [as=t_st_id_cast:127] │ │ │ └── '2020-06-15 22:27:42.148484' [as=t_dts_new:126] │ │ └── f-k-checks │ │ └── f-k-checks-item: trade(t_st_id) -> status_type(st_id) @@ -769,7 +769,7 @@ with &2 (update_last_trade) │ │ ├── with-scan &7 │ │ │ ├── columns: t_st_id:133!null │ │ │ ├── mapping: - │ │ │ │ └── column127:127 => t_st_id:133 + │ │ │ │ └── t_st_id_cast:127 => t_st_id:133 │ │ │ └── fd: ()-->(133) │ │ └── filters (true) │ └── projections @@ -2937,18 +2937,18 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:18 => t_id:1 │ │ │ ├── column2:19 => t_dts:2 - │ │ │ ├── column33:33 => trade.t_st_id:3 - │ │ │ ├── column34:34 => trade.t_tt_id:4 + │ │ │ ├── t_st_id_cast:33 => trade.t_st_id:3 + │ │ │ ├── t_tt_id_cast:34 => trade.t_tt_id:4 │ │ │ ├── column5:22 => t_is_cash:5 - │ │ │ ├── column35:35 => trade.t_s_symb:6 - │ │ │ ├── column36:36 => t_qty:7 - │ │ │ ├── column37:37 => t_bid_price:8 + │ │ │ ├── t_s_symb_cast:35 => trade.t_s_symb:6 + │ │ │ ├── t_qty_cast:36 => t_qty:7 + │ │ │ ├── t_bid_price_cast:37 => t_bid_price:8 │ │ │ ├── column9:26 => trade.t_ca_id:9 - │ │ │ ├── column38:38 => t_exec_name:10 + │ │ │ ├── t_exec_name_cast:38 => t_exec_name:10 │ │ │ ├── column11:28 => t_trade_price:11 - │ │ │ ├── column39:39 => t_chrg:12 - │ │ │ ├── column40:40 => t_comm:13 - │ │ │ ├── column41:41 => t_tax:14 + │ │ │ ├── t_chrg_cast:39 => t_chrg:12 + │ │ │ ├── t_comm_cast:40 => t_comm:13 + │ │ │ ├── t_tax_cast:41 => t_tax:14 │ │ │ └── column15:32 => t_lifo:15 │ │ ├── check columns: check1:42 check2:43 check3:44 check4:45 check5:46 │ │ ├── input binding: &1 @@ -2957,7 +2957,7 @@ with &2 (insert_trade) │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null column33:33!null column34:34!null column35:35!null column36:36!null column37:37!null column38:38!null column39:39!null column40:40!null column41:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null + │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null t_st_id_cast:33!null t_tt_id_cast:34!null t_s_symb_cast:35!null t_qty_cast:36!null t_bid_price_cast:37!null t_exec_name_cast:38!null t_chrg_cast:39!null t_comm_cast:40!null t_tax_cast:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(18,19,22,26,28,32-46) @@ -2974,7 +2974,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_st_id:47!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column33:33 => t_st_id:47 + │ │ │ │ │ └── t_st_id_cast:33 => t_st_id:47 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(47) @@ -2990,7 +2990,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_tt_id:52!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column34:34 => t_tt_id:52 + │ │ │ │ │ └── t_tt_id_cast:34 => t_tt_id:52 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(52) @@ -3006,7 +3006,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_s_symb:59!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column35:35 => t_s_symb:59 + │ │ │ │ │ └── t_s_symb_cast:35 => t_s_symb:59 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(59) @@ -3046,14 +3046,14 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:93 => trade_history.th_t_id:88 │ │ │ ├── column2:94 => th_dts:89 - │ │ │ └── column96:96 => trade_history.th_st_id:90 + │ │ │ └── th_st_id_cast:96 => trade_history.th_st_id:90 │ │ ├── input binding: &3 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(88,90) │ │ ├── values - │ │ │ ├── columns: column1:93!null column2:94!null column96:96!null + │ │ │ ├── columns: column1:93!null column2:94!null th_st_id_cast:96!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(93,94,96) @@ -3086,7 +3086,7 @@ with &2 (insert_trade) │ │ ├── with-scan &3 │ │ │ ├── columns: th_st_id:115!null │ │ │ ├── mapping: - │ │ │ │ └── column96:96 => th_st_id:115 + │ │ │ │ └── th_st_id_cast:96 => th_st_id:115 │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(115) @@ -3187,18 +3187,18 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:18 => t_id:1 │ │ │ ├── column2:19 => t_dts:2 - │ │ │ ├── column33:33 => trade.t_st_id:3 - │ │ │ ├── column34:34 => trade.t_tt_id:4 + │ │ │ ├── t_st_id_cast:33 => trade.t_st_id:3 + │ │ │ ├── t_tt_id_cast:34 => trade.t_tt_id:4 │ │ │ ├── column5:22 => t_is_cash:5 - │ │ │ ├── column35:35 => trade.t_s_symb:6 - │ │ │ ├── column36:36 => t_qty:7 - │ │ │ ├── column37:37 => t_bid_price:8 + │ │ │ ├── t_s_symb_cast:35 => trade.t_s_symb:6 + │ │ │ ├── t_qty_cast:36 => t_qty:7 + │ │ │ ├── t_bid_price_cast:37 => t_bid_price:8 │ │ │ ├── column9:26 => trade.t_ca_id:9 - │ │ │ ├── column38:38 => t_exec_name:10 + │ │ │ ├── t_exec_name_cast:38 => t_exec_name:10 │ │ │ ├── column11:28 => t_trade_price:11 - │ │ │ ├── column39:39 => t_chrg:12 - │ │ │ ├── column40:40 => t_comm:13 - │ │ │ ├── column41:41 => t_tax:14 + │ │ │ ├── t_chrg_cast:39 => t_chrg:12 + │ │ │ ├── t_comm_cast:40 => t_comm:13 + │ │ │ ├── t_tax_cast:41 => t_tax:14 │ │ │ └── column15:32 => t_lifo:15 │ │ ├── check columns: check1:42 check2:43 check3:44 check4:45 check5:46 │ │ ├── input binding: &1 @@ -3207,7 +3207,7 @@ with &2 (insert_trade) │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null column33:33!null column34:34!null column35:35!null column36:36!null column37:37!null column38:38!null column39:39!null column40:40!null column41:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null + │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null t_st_id_cast:33!null t_tt_id_cast:34!null t_s_symb_cast:35!null t_qty_cast:36!null t_bid_price_cast:37!null t_exec_name_cast:38!null t_chrg_cast:39!null t_comm_cast:40!null t_tax_cast:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(18,19,22,26,28,32-46) @@ -3224,7 +3224,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_st_id:47!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column33:33 => t_st_id:47 + │ │ │ │ │ └── t_st_id_cast:33 => t_st_id:47 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(47) @@ -3240,7 +3240,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_tt_id:52!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column34:34 => t_tt_id:52 + │ │ │ │ │ └── t_tt_id_cast:34 => t_tt_id:52 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(52) @@ -3256,7 +3256,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_s_symb:59!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column35:35 => t_s_symb:59 + │ │ │ │ │ └── t_s_symb_cast:35 => t_s_symb:59 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(59) @@ -3296,14 +3296,14 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:93 => trade_history.th_t_id:88 │ │ │ ├── column2:94 => th_dts:89 - │ │ │ └── column96:96 => trade_history.th_st_id:90 + │ │ │ └── th_st_id_cast:96 => trade_history.th_st_id:90 │ │ ├── input binding: &3 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(88,90) │ │ ├── values - │ │ │ ├── columns: column1:93!null column2:94!null column96:96!null + │ │ │ ├── columns: column1:93!null column2:94!null th_st_id_cast:96!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(93,94,96) @@ -3336,7 +3336,7 @@ with &2 (insert_trade) │ │ ├── with-scan &3 │ │ │ ├── columns: th_st_id:115!null │ │ │ ├── mapping: - │ │ │ │ └── column96:96 => th_st_id:115 + │ │ │ │ └── th_st_id_cast:96 => th_st_id:115 │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(115) @@ -3359,10 +3359,10 @@ with &2 (insert_trade) │ │ ├── columns: trade_request.tr_t_id:121!null │ │ ├── insert-mapping: │ │ │ ├── column1:129 => trade_request.tr_t_id:121 - │ │ │ ├── column135:135 => trade_request.tr_tt_id:122 - │ │ │ ├── column136:136 => trade_request.tr_s_symb:123 - │ │ │ ├── column137:137 => tr_qty:124 - │ │ │ ├── column138:138 => tr_bid_price:125 + │ │ │ ├── tr_tt_id_cast:135 => trade_request.tr_tt_id:122 + │ │ │ ├── tr_s_symb_cast:136 => trade_request.tr_s_symb:123 + │ │ │ ├── tr_qty_cast:137 => tr_qty:124 + │ │ │ ├── tr_bid_price_cast:138 => tr_bid_price:125 │ │ │ └── column6:134 => trade_request.tr_b_id:126 │ │ ├── check columns: check1:139 check2:140 │ │ ├── partial index put columns: partial_index_put1:141 @@ -3372,7 +3372,7 @@ with &2 (insert_trade) │ │ ├── key: () │ │ ├── fd: ()-->(121) │ │ ├── values - │ │ │ ├── columns: column1:129!null column6:134!null column135:135!null column136:136!null column137:137!null column138:138!null check1:139!null check2:140!null partial_index_put1:141!null + │ │ │ ├── columns: column1:129!null column6:134!null tr_tt_id_cast:135!null tr_s_symb_cast:136!null tr_qty_cast:137!null tr_bid_price_cast:138!null check1:139!null check2:140!null partial_index_put1:141!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(129,134-141) @@ -3405,7 +3405,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &5 │ │ │ │ ├── columns: tr_tt_id:160!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column135:135 => tr_tt_id:160 + │ │ │ │ │ └── tr_tt_id_cast:135 => tr_tt_id:160 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(160) @@ -3421,7 +3421,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &5 │ │ │ │ ├── columns: tr_s_symb:167!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column136:136 => tr_s_symb:167 + │ │ │ │ │ └── tr_s_symb_cast:136 => tr_s_symb:167 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(167) @@ -3599,13 +3599,13 @@ insert holding_summary ├── columns: ├── insert-mapping: │ ├── column1:6 => holding_summary.hs_ca_id:1 - │ ├── column9:9 => holding_summary.hs_s_symb:2 - │ └── column10:10 => hs_qty:3 + │ ├── hs_s_symb_cast:9 => holding_summary.hs_s_symb:2 + │ └── hs_qty_cast:10 => hs_qty:3 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── values - │ ├── columns: column1:6!null column9:9!null column10:10!null + │ ├── columns: column1:6!null hs_s_symb_cast:9!null hs_qty_cast:10!null │ ├── cardinality: [1 - 1] │ ├── key: () │ ├── fd: ()-->(6,9,10) @@ -3638,7 +3638,7 @@ insert holding_summary ├── with-scan &1 │ ├── columns: hs_s_symb:20!null │ ├── mapping: - │ │ └── column9:9 => hs_s_symb:20 + │ │ └── hs_s_symb_cast:9 => hs_s_symb:20 │ ├── cardinality: [1 - 1] │ ├── key: () │ └── fd: ()-->(20) @@ -3654,11 +3654,11 @@ update holding_summary ├── columns: ├── fetch columns: hs_ca_id:6 hs_s_symb:7 hs_qty:8 ├── update-mapping: - │ └── column12:12 => hs_qty:3 + │ └── hs_qty_cast:12 => hs_qty:3 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column12:12!null hs_ca_id:6!null hs_s_symb:7!null hs_qty:8!null + ├── columns: hs_qty_cast:12!null hs_ca_id:6!null hs_s_symb:7!null hs_qty:8!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -3670,7 +3670,7 @@ update holding_summary │ ├── key: () │ └── fd: ()-->(6-8) └── projections - └── assignment-cast: INT4 [as=column12:12, outer=(8), immutable] + └── assignment-cast: INT4 [as=hs_qty_cast:12, outer=(8), immutable] └── hs_qty:8::INT8 + 10 # Q5 @@ -3785,11 +3785,11 @@ update holding ├── columns: ├── fetch columns: h_t_id:9 h_ca_id:10 h_s_symb:11 h_dts:12 h_price:13 h_qty:14 ├── update-mapping: - │ └── column18:18 => h_qty:6 + │ └── h_qty_cast:18 => h_qty:6 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column18:18!null h_t_id:9!null h_ca_id:10!null h_s_symb:11!null h_dts:12!null h_price:13!null h_qty:14!null + ├── columns: h_qty_cast:18!null h_t_id:9!null h_ca_id:10!null h_s_symb:11!null h_dts:12!null h_price:13!null h_qty:14!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -3801,7 +3801,7 @@ update holding │ ├── key: () │ └── fd: ()-->(9-14) └── projections - └── assignment-cast: INT4 [as=column18:18, outer=(14), immutable] + └── assignment-cast: INT4 [as=h_qty_cast:18, outer=(14), immutable] └── h_qty:14::INT8 + 10 # Q9 @@ -3839,16 +3839,16 @@ insert holding ├── insert-mapping: │ ├── column1:9 => holding.h_t_id:1 │ ├── column2:10 => holding.h_ca_id:2 - │ ├── column15:15 => holding.h_s_symb:3 + │ ├── h_s_symb_cast:15 => holding.h_s_symb:3 │ ├── column4:12 => h_dts:4 - │ ├── column16:16 => h_price:5 - │ └── column17:17 => h_qty:6 + │ ├── h_price_cast:16 => h_price:5 + │ └── h_qty_cast:17 => h_qty:6 ├── check columns: check1:18 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── values - │ ├── columns: column1:9!null column2:10!null column4:12!null column15:15!null column16:16!null column17:17!null check1:18!null + │ ├── columns: column1:9!null column2:10!null column4:12!null h_s_symb_cast:15!null h_price_cast:16!null h_qty_cast:17!null check1:18!null │ ├── cardinality: [1 - 1] │ ├── key: () │ ├── fd: ()-->(9,10,12,15-18) @@ -3882,7 +3882,7 @@ insert holding │ ├── columns: h_ca_id:37!null h_s_symb:38!null │ ├── mapping: │ │ ├── column2:10 => h_ca_id:37 - │ │ └── column15:15 => h_s_symb:38 + │ │ └── h_s_symb_cast:15 => h_s_symb:38 │ ├── cardinality: [1 - 1] │ ├── key: () │ └── fd: ()-->(37,38) @@ -3944,20 +3944,20 @@ project │ ├── columns: t_id:1!null trade.t_tax:14!null │ ├── fetch columns: t_id:18 trade.t_tax:31 │ ├── update-mapping: - │ │ └── column46:46 => trade.t_tax:14 + │ │ └── t_tax_cast:46 => trade.t_tax:14 │ ├── check columns: check5:51 │ ├── cardinality: [0 - 1] │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1,14) │ └── project - │ ├── columns: check5:51 t_id:18!null trade.t_tax:31!null column46:46 + │ ├── columns: check5:51 t_id:18!null trade.t_tax:31!null t_tax_cast:46 │ ├── cardinality: [0 - 1] │ ├── immutable │ ├── key: () │ ├── fd: ()-->(18,31,46,51) │ ├── project - │ │ ├── columns: column46:46 t_id:18!null trade.t_tax:31!null + │ │ ├── columns: t_tax_cast:46 t_id:18!null trade.t_tax:31!null │ │ ├── cardinality: [0 - 1] │ │ ├── immutable │ │ ├── key: () @@ -3969,7 +3969,7 @@ project │ │ │ ├── key: () │ │ │ └── fd: ()-->(18,31) │ │ └── projections - │ │ └── assignment-cast: DECIMAL(10,2) [as=column46:46, immutable, subquery] + │ │ └── assignment-cast: DECIMAL(10,2) [as=t_tax_cast:46, immutable, subquery] │ │ └── mult │ │ ├── subquery │ │ │ └── scalar-group-by @@ -3994,7 +3994,7 @@ project │ │ │ └── tx_rate:37 │ │ └── 2E+1 │ └── projections - │ └── column46:46 >= 0 [as=check5:51, outer=(46), immutable] + │ └── t_tax_cast:46 >= 0 [as=check5:51, outer=(46), immutable] └── projections └── trade.t_tax:14::FLOAT8 [as=t_tax:52, outer=(14), immutable] @@ -4174,9 +4174,9 @@ with &2 (update_trade_commission) │ │ ├── fetch columns: t_id:18 t_dts:19 trade.t_st_id:20 t_tt_id:21 t_is_cash:22 t_s_symb:23 t_qty:24 t_bid_price:25 t_ca_id:26 t_exec_name:27 t_trade_price:28 t_chrg:29 t_comm:30 t_lifo:32 │ │ ├── update-mapping: │ │ │ ├── t_dts_new:36 => t_dts:2 - │ │ │ ├── column39:39 => trade.t_st_id:3 - │ │ │ ├── column40:40 => t_trade_price:11 - │ │ │ └── column41:41 => t_comm:13 + │ │ │ ├── t_st_id_cast:39 => trade.t_st_id:3 + │ │ │ ├── t_trade_price_cast:40 => t_trade_price:11 + │ │ │ └── t_comm_cast:41 => t_comm:13 │ │ ├── check columns: check4:45 │ │ ├── input binding: &1 │ │ ├── cardinality: [0 - 1] @@ -4184,7 +4184,7 @@ with &2 (update_trade_commission) │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── project - │ │ │ ├── columns: check4:45!null column41:41!null column39:39!null column40:40!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null + │ │ │ ├── columns: check4:45!null t_comm_cast:41!null t_st_id_cast:39!null t_trade_price_cast:40!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(18-30,32,36,39-41,45) @@ -4196,9 +4196,9 @@ with &2 (update_trade_commission) │ │ │ │ └── fd: ()-->(18-30,32) │ │ │ └── projections │ │ │ ├── true [as=check4:45] - │ │ │ ├── 50.00 [as=column41:41] - │ │ │ ├── 'ACTV' [as=column39:39] - │ │ │ ├── 100.00 [as=column40:40] + │ │ │ ├── 50.00 [as=t_comm_cast:41] + │ │ │ ├── 'ACTV' [as=t_st_id_cast:39] + │ │ │ ├── 100.00 [as=t_trade_price_cast:40] │ │ │ └── '2020-06-15 22:27:42.148484' [as=t_dts_new:36] │ │ └── f-k-checks │ │ └── f-k-checks-item: trade(t_st_id) -> status_type(st_id) @@ -4212,7 +4212,7 @@ with &2 (update_trade_commission) │ │ ├── with-scan &1 │ │ │ ├── columns: t_st_id:47!null │ │ │ ├── mapping: - │ │ │ │ └── column39:39 => t_st_id:47 + │ │ │ │ └── t_st_id_cast:39 => t_st_id:47 │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(47) @@ -4236,13 +4236,13 @@ with &2 (update_trade_commission) │ │ ├── fetch columns: b_id:60 b_num_trades:63 b_comm_total:64 │ │ ├── update-mapping: │ │ │ ├── b_num_trades_new:68 => b_num_trades:56 - │ │ │ └── column69:69 => b_comm_total:57 + │ │ │ └── b_comm_total_cast:69 => b_comm_total:57 │ │ ├── cardinality: [0 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(53) │ │ └── project - │ │ ├── columns: column69:69!null b_num_trades_new:68!null b_id:60!null b_num_trades:63!null b_comm_total:64!null + │ │ ├── columns: b_comm_total_cast:69!null b_num_trades_new:68!null b_id:60!null b_num_trades:63!null b_comm_total:64!null │ │ ├── cardinality: [0 - 1] │ │ ├── immutable │ │ ├── key: () @@ -4254,7 +4254,7 @@ with &2 (update_trade_commission) │ │ │ ├── key: () │ │ │ └── fd: ()-->(60,63,64) │ │ └── projections - │ │ ├── assignment-cast: DECIMAL(12,2) [as=column69:69, outer=(64), immutable] + │ │ ├── assignment-cast: DECIMAL(12,2) [as=b_comm_total_cast:69, outer=(64), immutable] │ │ │ └── b_comm_total:64::DECIMAL + 5E+1 │ │ └── b_num_trades:63 + 1 [as=b_num_trades_new:68, outer=(63), immutable] │ └── projections @@ -4276,14 +4276,14 @@ with &2 (update_trade_commission) │ │ ├── insert-mapping: │ │ │ ├── column1:76 => trade_history.th_t_id:71 │ │ │ ├── column2:77 => th_dts:72 - │ │ │ └── column79:79 => trade_history.th_st_id:73 + │ │ │ └── th_st_id_cast:79 => trade_history.th_st_id:73 │ │ ├── input binding: &5 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(71,73) │ │ ├── values - │ │ │ ├── columns: column1:76!null column2:77!null column79:79!null + │ │ │ ├── columns: column1:76!null column2:77!null th_st_id_cast:79!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(76,77,79) @@ -4316,7 +4316,7 @@ with &2 (update_trade_commission) │ │ ├── with-scan &5 │ │ │ ├── columns: th_st_id:98!null │ │ │ ├── mapping: - │ │ │ │ └── column79:79 => th_st_id:98 + │ │ │ │ └── th_st_id_cast:79 => th_st_id:98 │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(98) @@ -4372,16 +4372,16 @@ with &2 (insert_settlement) │ │ ├── columns: settlement.se_t_id:1!null │ │ ├── insert-mapping: │ │ │ ├── column1:7 => settlement.se_t_id:1 - │ │ │ ├── column11:11 => se_cash_type:2 + │ │ │ ├── se_cash_type_cast:11 => se_cash_type:2 │ │ │ ├── column3:9 => se_cash_due_date:3 - │ │ │ └── column12:12 => se_amt:4 + │ │ │ └── se_amt_cast:12 => se_amt:4 │ │ ├── input binding: &1 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:7!null column3:9!null column11:11!null column12:12!null + │ │ │ ├── columns: column1:7!null column3:9!null se_cash_type_cast:11!null se_amt_cast:12!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(7,9,11,12) @@ -4422,15 +4422,15 @@ with &2 (insert_settlement) │ │ ├── insert-mapping: │ │ │ ├── column1:38 => cash_transaction.ct_t_id:32 │ │ │ ├── column2:39 => ct_dts:33 - │ │ │ ├── column42:42 => ct_amt:34 - │ │ │ └── column43:43 => ct_name:35 + │ │ │ ├── ct_amt_cast:42 => ct_amt:34 + │ │ │ └── ct_name_cast:43 => ct_name:35 │ │ ├── input binding: &3 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(32) │ │ ├── values - │ │ │ ├── columns: column1:38!null column2:39!null column42:42!null column43:43!null + │ │ │ ├── columns: column1:38!null column2:39!null ct_amt_cast:42!null ct_name_cast:43!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(38,39,42,43) @@ -4464,13 +4464,13 @@ with &2 (insert_settlement) │ ├── columns: ca_id:63!null customer_account.ca_bal:68!null │ ├── fetch columns: ca_id:71 ca_b_id:72 ca_c_id:73 ca_name:74 ca_tax_st:75 customer_account.ca_bal:76 │ ├── update-mapping: - │ │ └── column80:80 => customer_account.ca_bal:68 + │ │ └── ca_bal_cast:80 => customer_account.ca_bal:68 │ ├── cardinality: [0 - 1] │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(63,68) │ └── project - │ ├── columns: column80:80!null ca_id:71!null ca_b_id:72!null ca_c_id:73!null ca_name:74 ca_tax_st:75!null customer_account.ca_bal:76!null + │ ├── columns: ca_bal_cast:80!null ca_id:71!null ca_b_id:72!null ca_c_id:73!null ca_name:74 ca_tax_st:75!null customer_account.ca_bal:76!null │ ├── cardinality: [0 - 1] │ ├── immutable │ ├── key: () @@ -4482,7 +4482,7 @@ with &2 (insert_settlement) │ │ ├── key: () │ │ └── fd: ()-->(71-76) │ └── projections - │ └── assignment-cast: DECIMAL(12,2) [as=column80:80, outer=(76), immutable] + │ └── assignment-cast: DECIMAL(12,2) [as=ca_bal_cast:80, outer=(76), immutable] │ └── customer_account.ca_bal:76::DECIMAL + 1E+2 └── projections └── customer_account.ca_bal:68::FLOAT8 [as=ca_bal:82, outer=(68), immutable] @@ -4514,16 +4514,16 @@ with &2 (insert_settlement) │ │ ├── columns: settlement.se_t_id:1!null │ │ ├── insert-mapping: │ │ │ ├── column1:7 => settlement.se_t_id:1 - │ │ │ ├── column11:11 => se_cash_type:2 + │ │ │ ├── se_cash_type_cast:11 => se_cash_type:2 │ │ │ ├── column3:9 => se_cash_due_date:3 - │ │ │ └── column12:12 => se_amt:4 + │ │ │ └── se_amt_cast:12 => se_amt:4 │ │ ├── input binding: &1 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:7!null column3:9!null column11:11!null column12:12!null + │ │ │ ├── columns: column1:7!null column3:9!null se_cash_type_cast:11!null se_amt_cast:12!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(7,9,11,12) @@ -5054,11 +5054,11 @@ update trade ├── columns: ├── fetch columns: t_id:18 t_dts:19 t_st_id:20 t_tt_id:21 t_is_cash:22 t_s_symb:23 t_qty:24 t_bid_price:25 t_ca_id:26 t_exec_name:27 t_trade_price:28 t_chrg:29 t_comm:30 t_lifo:32 ├── update-mapping: - │ └── column36:36 => t_exec_name:10 + │ └── t_exec_name_cast:36 => t_exec_name:10 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column36:36 t_id:18!null t_dts:19!null t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null + ├── columns: t_exec_name_cast:36 t_id:18!null t_dts:19!null t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null ├── cardinality: [0 - 4] ├── immutable ├── key: (18) @@ -5070,7 +5070,7 @@ update trade │ ├── key: (18) │ └── fd: (18)-->(19-30,32) └── projections - └── assignment-cast: VARCHAR(49) [as=column36:36, outer=(27), immutable] + └── assignment-cast: VARCHAR(49) [as=t_exec_name_cast:36, outer=(27), immutable] └── CASE t_exec_name:27 LIKE '% X %' WHEN true THEN replace(t_exec_name:27, ' X ', ' ') ELSE replace(t_exec_name:27, ' ', ' X ') END # Q3 @@ -5240,11 +5240,11 @@ update settlement ├── columns: ├── fetch columns: se_t_id:7 se_cash_type:8 se_cash_due_date:9 se_amt:10 ├── update-mapping: - │ └── column16:16 => se_cash_type:2 + │ └── se_cash_type_cast:16 => se_cash_type:2 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column16:16!null se_t_id:7!null se_cash_type:8!null se_cash_due_date:9!null se_amt:10!null unnest:13!null unnest:14!null + ├── columns: se_cash_type_cast:16!null se_t_id:7!null se_cash_type:8!null se_cash_due_date:9!null se_amt:10!null unnest:13!null unnest:14!null ├── cardinality: [0 - 4] ├── immutable ├── key: (7) @@ -5281,7 +5281,7 @@ update settlement │ └── first-agg [as=unnest:14, outer=(14)] │ └── unnest:14 └── projections - └── assignment-cast: VARCHAR(40) [as=column16:16, outer=(8,14), immutable] + └── assignment-cast: VARCHAR(40) [as=se_cash_type_cast:16, outer=(8,14), immutable] └── CASE unnest:14 WHEN true THEN CASE se_cash_type:8 = 'Cash Account' WHEN true THEN 'Cash' ELSE 'Cash Account' END ELSE CASE se_cash_type:8 = 'Margin Account' WHEN true THEN 'Margin' ELSE 'Margin Account' END END # Q6 @@ -5502,11 +5502,11 @@ update cash_transaction ├── columns: ├── fetch columns: ct_t_id:7 ct_dts:8 ct_amt:9 ct_name:10 ├── update-mapping: - │ └── column18:18 => ct_name:4 + │ └── ct_name_cast:18 => ct_name:4 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column18:18 ct_t_id:7!null ct_dts:8!null ct_amt:9!null ct_name:10 unnest:13!null unnest:14!null unnest:15!null unnest:16!null + ├── columns: ct_name_cast:18 ct_t_id:7!null ct_dts:8!null ct_amt:9!null ct_name:10 unnest:13!null unnest:14!null unnest:15!null unnest:16!null ├── cardinality: [0 - 4] ├── immutable ├── key: (7) @@ -5547,7 +5547,7 @@ update cash_transaction │ └── first-agg [as=unnest:16, outer=(16)] │ └── unnest:16 └── projections - └── assignment-cast: VARCHAR(100) [as=column18:18, outer=(10,14-16), immutable] + └── assignment-cast: VARCHAR(100) [as=ct_name_cast:18, outer=(10,14-16), immutable] └── concat_ws(' ', unnest:14, unnest:15::STRING, CASE ct_name:10 LIKE '% shares of %' WHEN true THEN 'Shares of' ELSE 'shares of' END, unnest:16) # -------------------------------------------------- @@ -5590,11 +5590,11 @@ update account_permission ├── columns: ├── fetch columns: ap_ca_id:8 ap_acl:9 ap_tax_id:10 ap_l_name:11 ap_f_name:12 ├── update-mapping: - │ └── column16:16 => ap_acl:2 + │ └── ap_acl_cast:16 => ap_acl:2 ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: ap_ca_id:8!null ap_acl:9!null ap_tax_id:10!null ap_l_name:11!null ap_f_name:12!null column16:16!null + ├── columns: ap_ca_id:8!null ap_acl:9!null ap_tax_id:10!null ap_l_name:11!null ap_f_name:12!null ap_acl_cast:16!null ├── cardinality: [0 - 0] ├── key: () └── fd: ()-->(8-12,16) @@ -5659,11 +5659,11 @@ update address ├── columns: ├── fetch columns: ad_id:8 ad_line1:9 ad_line2:10 ad_zc_code:11 ad_ctry:12 ├── update-mapping: - │ └── column16:16 => ad_line2:3 + │ └── ad_line2_cast:16 => ad_line2:3 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column16:16!null ad_id:8!null ad_line1:9 ad_line2:10 ad_zc_code:11!null ad_ctry:12 + ├── columns: ad_line2_cast:16!null ad_id:8!null ad_line1:9 ad_line2:10 ad_zc_code:11!null ad_ctry:12 ├── cardinality: [0 - 1] ├── key: () ├── fd: ()-->(8-12,16) @@ -5674,7 +5674,7 @@ update address │ ├── key: () │ └── fd: ()-->(8-12) └── projections - └── '' [as=column16:16] + └── '' [as=ad_line2_cast:16] # Q6 opt @@ -5684,11 +5684,11 @@ update company ├── columns: ├── fetch columns: co_id:12 co_st_id:13 co_name:14 co_in_id:15 co_sp_rate:16 co_ceo:17 co_ad_id:18 co_desc:19 co_open_date:20 ├── update-mapping: - │ └── column24:24 => co_sp_rate:5 + │ └── co_sp_rate_cast:24 => co_sp_rate:5 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column24:24!null co_id:12!null co_st_id:13!null co_name:14!null co_in_id:15!null co_sp_rate:16!null co_ceo:17!null co_ad_id:18!null co_desc:19!null co_open_date:20!null + ├── columns: co_sp_rate_cast:24!null co_id:12!null co_st_id:13!null co_name:14!null co_in_id:15!null co_sp_rate:16!null co_ceo:17!null co_ad_id:18!null co_desc:19!null co_open_date:20!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -5700,7 +5700,7 @@ update company │ ├── key: () │ └── fd: ()-->(12-20) └── projections - └── assignment-cast: VARCHAR(4) [as=column24:24, outer=(16), immutable] + └── assignment-cast: VARCHAR(4) [as=co_sp_rate_cast:24, outer=(16), immutable] └── CASE co_sp_rate:16 != 'ABA' WHEN true THEN 'ABA' ELSE 'AAA' END # Q7 @@ -5714,11 +5714,11 @@ update customer ├── columns: ├── fetch columns: c_id:27 c_tax_id:28 c_st_id:29 c_l_name:30 c_f_name:31 c_m_name:32 c_gndr:33 c_tier:34 c_dob:35 c_ad_id:36 c_ctry_1:37 c_area_1:38 c_local_1:39 c_ext_1:40 c_ctry_2:41 c_area_2:42 c_local_2:43 c_ext_2:44 c_ctry_3:45 c_area_3:46 c_local_3:47 c_ext_3:48 c_email_1:49 c_email_2:50 ├── update-mapping: - │ └── column54:54 => c_email_2:24 + │ └── c_email_2_cast:54 => c_email_2:24 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column54:54 c_id:27!null c_tax_id:28!null c_st_id:29!null c_l_name:30!null c_f_name:31!null c_m_name:32 c_gndr:33 c_tier:34!null c_dob:35!null c_ad_id:36!null c_ctry_1:37 c_area_1:38 c_local_1:39 c_ext_1:40 c_ctry_2:41 c_area_2:42 c_local_2:43 c_ext_2:44 c_ctry_3:45 c_area_3:46 c_local_3:47 c_ext_3:48 c_email_1:49 c_email_2:50 + ├── columns: c_email_2_cast:54 c_id:27!null c_tax_id:28!null c_st_id:29!null c_l_name:30!null c_f_name:31!null c_m_name:32 c_gndr:33 c_tier:34!null c_dob:35!null c_ad_id:36!null c_ctry_1:37 c_area_1:38 c_local_1:39 c_ext_1:40 c_ctry_2:41 c_area_2:42 c_local_2:43 c_ext_2:44 c_ctry_3:45 c_area_3:46 c_local_3:47 c_ext_3:48 c_email_1:49 c_email_2:50 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -5730,7 +5730,7 @@ update customer │ ├── key: () │ └── fd: ()-->(27-50) └── projections - └── assignment-cast: VARCHAR(50) [as=column54:54, outer=(50), immutable] + └── assignment-cast: VARCHAR(50) [as=c_email_2_cast:54, outer=(50), immutable] └── left(c_email_2:50, strpos(c_email_2:50, '@')) || CASE c_email_2:50 LIKE '%@mindspring.com' WHEN true THEN 'earthlink.com' ELSE 'mindspring.com' END # Q8 @@ -5755,12 +5755,12 @@ update customer_taxrate ├── columns: ├── fetch columns: customer_taxrate.cx_tx_id:5 cx_c_id:6 ├── update-mapping: - │ └── column10:10 => customer_taxrate.cx_tx_id:1 + │ └── cx_tx_id_cast:10 => customer_taxrate.cx_tx_id:1 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: column10:10 customer_taxrate.cx_tx_id:5!null cx_c_id:6!null + │ ├── columns: cx_tx_id_cast:10 customer_taxrate.cx_tx_id:5!null cx_c_id:6!null │ ├── immutable │ ├── key: (5) │ ├── fd: ()-->(6), (5)-->(10) @@ -5772,7 +5772,7 @@ update customer_taxrate │ │ ├── key: (5) │ │ └── fd: ()-->(6) │ └── projections - │ └── assignment-cast: VARCHAR(4) [as=column10:10, outer=(5), immutable] + │ └── assignment-cast: VARCHAR(4) [as=cx_tx_id_cast:10, outer=(5), immutable] │ └── CASE left(customer_taxrate.cx_tx_id:5, 2) = 'US' WHEN true THEN CASE customer_taxrate.cx_tx_id:5 = 'US5' WHEN true THEN 'US1' ELSE 'US' || (right(customer_taxrate.cx_tx_id:5, 1)::INT8 + 1)::STRING END ELSE CASE customer_taxrate.cx_tx_id:5 = 'CN4' WHEN true THEN 'CN1' ELSE 'CN' || (right(customer_taxrate.cx_tx_id:5, 1)::INT8 + 1)::STRING END END └── f-k-checks └── f-k-checks-item: customer_taxrate(cx_tx_id) -> taxrate(tx_id) @@ -5783,7 +5783,7 @@ update customer_taxrate ├── with-scan &1 │ ├── columns: cx_tx_id:11 │ └── mapping: - │ └── column10:10 => cx_tx_id:11 + │ └── cx_tx_id_cast:10 => cx_tx_id:11 └── filters (true) # Q9 @@ -5833,11 +5833,11 @@ update exchange ├── columns: ├── fetch columns: ex_id:10 ex_name:11 ex_num_symb:12 ex_open:13 ex_close:14 ex_desc:15 ex_ad_id:16 ├── update-mapping: - │ └── column20:20 => ex_desc:6 + │ └── ex_desc_cast:20 => ex_desc:6 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column20:20 ex_id:10!null ex_name:11!null ex_num_symb:12!null ex_open:13!null ex_close:14!null ex_desc:15 ex_ad_id:16!null + ├── columns: ex_desc_cast:20 ex_id:10!null ex_name:11!null ex_num_symb:12!null ex_open:13!null ex_close:14!null ex_desc:15 ex_ad_id:16!null ├── immutable ├── key: (10) ├── fd: (10)-->(11-16), (15)-->(20) @@ -5846,7 +5846,7 @@ update exchange │ ├── key: (10) │ └── fd: (10)-->(11-16) └── projections - └── assignment-cast: VARCHAR(150) [as=column20:20, outer=(15), immutable] + └── assignment-cast: VARCHAR(150) [as=ex_desc_cast:20, outer=(15), immutable] └── CASE ex_desc:15 NOT LIKE '%LAST UPDATED%' WHEN true THEN (ex_desc:15::STRING || ' LAST UPDATED ') || '2017-05-10 13:00:00' ELSE substring(ex_desc:15, 1, length(ex_desc:15) - 19) || '2017-05-10 13:00:00' END # Q11 @@ -5960,11 +5960,11 @@ update taxrate ├── columns: ├── fetch columns: tx_id:6 tx_name:7 tx_rate:8 ├── update-mapping: - │ └── column12:12 => tx_name:2 + │ └── tx_name_cast:12 => tx_name:2 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column12:12 tx_id:6!null tx_name:7!null tx_rate:8!null + ├── columns: tx_name_cast:12 tx_id:6!null tx_name:7!null tx_rate:8!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -5976,7 +5976,7 @@ update taxrate │ ├── key: () │ └── fd: ()-->(6-8) └── projections - └── assignment-cast: VARCHAR(50) [as=column12:12, outer=(7), immutable] + └── assignment-cast: VARCHAR(50) [as=tx_name_cast:12, outer=(7), immutable] └── CASE tx_name:7 LIKE '% Tax %' WHEN true THEN replace(tx_name:7, ' Tax ', ' tax ') ELSE replace(tx_name:7, ' tax ', ' Tax ') END # Q15 @@ -6103,12 +6103,12 @@ update watch_item ├── columns: ├── fetch columns: wi_wl_id:5 watch_item.wi_s_symb:6 ├── update-mapping: - │ └── column14:14 => watch_item.wi_s_symb:2 + │ └── wi_s_symb_cast:14 => watch_item.wi_s_symb:2 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: column14:14!null wi_wl_id:5!null watch_item.wi_s_symb:6!null wl_id:9!null wl_c_id:10!null watch_list.crdb_internal_mvcc_timestamp:11 watch_list.tableoid:12 + │ ├── columns: wi_s_symb_cast:14!null wi_wl_id:5!null watch_item.wi_s_symb:6!null wl_id:9!null wl_c_id:10!null watch_list.crdb_internal_mvcc_timestamp:11 watch_list.tableoid:12 │ ├── key: (9) │ ├── fd: ()-->(6,10,14), (9)-->(11,12), (5)==(9), (9)==(5) │ ├── inner-join (lookup watch_item) @@ -6134,7 +6134,7 @@ update watch_item │ │ │ └── 'ROACH' [as="lookup_join_const_col_@6":35] │ │ └── filters (true) │ └── projections - │ └── 'ROACH' [as=column14:14] + │ └── 'ROACH' [as=wi_s_symb_cast:14] └── f-k-checks └── f-k-checks-item: watch_item(wi_s_symb) -> security(s_symb) └── anti-join (lookup security) @@ -6145,7 +6145,7 @@ update watch_item ├── with-scan &1 │ ├── columns: wi_s_symb:15!null │ ├── mapping: - │ │ └── column14:14 => wi_s_symb:15 + │ │ └── wi_s_symb_cast:14 => wi_s_symb:15 │ └── fd: ()-->(15) └── filters (true) @@ -6228,12 +6228,12 @@ update trade ├── fetch columns: t_id:18 t_dts:19 trade.t_st_id:20 t_tt_id:21 t_is_cash:22 t_s_symb:23 t_qty:24 t_bid_price:25 t_ca_id:26 t_exec_name:27 t_trade_price:28 t_chrg:29 t_comm:30 t_lifo:32 ├── update-mapping: │ ├── t_dts_new:36 => t_dts:2 - │ └── column37:37 => trade.t_st_id:3 + │ └── t_st_id_cast:37 => trade.t_st_id:3 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: column37:37!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null + │ ├── columns: t_st_id_cast:37!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null │ ├── cardinality: [0 - 5] │ ├── key: (18) │ ├── fd: ()-->(36,37), (18)-->(19-30,32) @@ -6244,7 +6244,7 @@ update trade │ │ ├── key: (18) │ │ └── fd: (18)-->(19-30,32) │ └── projections - │ ├── 'PNDG' [as=column37:37] + │ ├── 'PNDG' [as=t_st_id_cast:37] │ └── '2020-06-15 22:27:42.148484' [as=t_dts_new:36] └── f-k-checks └── f-k-checks-item: trade(t_st_id) -> status_type(st_id) @@ -6257,7 +6257,7 @@ update trade ├── with-scan &1 │ ├── columns: t_st_id:43!null │ ├── mapping: - │ │ └── column37:37 => t_st_id:43 + │ │ └── t_st_id_cast:37 => t_st_id:43 │ ├── cardinality: [0 - 5] │ └── fd: ()-->(43) ├── scan status_type diff --git a/pkg/sql/opt/xform/testdata/external/tpce-no-stats b/pkg/sql/opt/xform/testdata/external/tpce-no-stats index aa6702e50c65..d12c296839eb 100644 --- a/pkg/sql/opt/xform/testdata/external/tpce-no-stats +++ b/pkg/sql/opt/xform/testdata/external/tpce-no-stats @@ -585,14 +585,14 @@ with &2 (update_last_trade) │ │ ├── fetch columns: lt_s_symb:8 lt_dts:9 lt_price:10 lt_open_price:11 lt_vol:12 │ │ ├── update-mapping: │ │ │ ├── lt_dts_new:17 => lt_dts:2 - │ │ │ ├── column18:18 => lt_price:3 + │ │ │ ├── lt_price_cast:18 => lt_price:3 │ │ │ └── lt_vol_new:15 => lt_vol:5 │ │ ├── cardinality: [0 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ └── project - │ │ ├── columns: column18:18!null lt_vol_new:15!null lt_dts_new:17!null lt_s_symb:8!null lt_dts:9!null lt_price:10!null lt_open_price:11!null lt_vol:12!null + │ │ ├── columns: lt_price_cast:18!null lt_vol_new:15!null lt_dts_new:17!null lt_s_symb:8!null lt_dts:9!null lt_price:10!null lt_open_price:11!null lt_vol:12!null │ │ ├── cardinality: [0 - 1] │ │ ├── immutable │ │ ├── key: () @@ -604,7 +604,7 @@ with &2 (update_last_trade) │ │ │ ├── key: () │ │ │ └── fd: ()-->(8-12) │ │ └── projections - │ │ ├── 100.00 [as=column18:18] + │ │ ├── 100.00 [as=lt_price_cast:18] │ │ ├── lt_vol:12 + 10 [as=lt_vol_new:15, outer=(12), immutable] │ │ └── '2020-06-15 22:27:42.148484' [as=lt_dts_new:17] │ └── projections @@ -692,13 +692,13 @@ with &2 (update_last_trade) │ │ ├── insert-mapping: │ │ │ ├── tr_t_id:56 => trade_history.th_t_id:51 │ │ │ ├── timestamp:61 => th_dts:52 - │ │ │ └── column62:62 => trade_history.th_st_id:53 + │ │ │ └── th_st_id_cast:62 => trade_history.th_st_id:53 │ │ ├── input binding: &5 │ │ ├── volatile, mutations │ │ ├── key: (51) │ │ ├── fd: ()-->(53) │ │ ├── project - │ │ │ ├── columns: column62:62!null timestamp:61!null tr_t_id:56!null + │ │ │ ├── columns: th_st_id_cast:62!null timestamp:61!null tr_t_id:56!null │ │ │ ├── key: (56) │ │ │ ├── fd: ()-->(61,62) │ │ │ ├── with-scan &3 (request_list) @@ -707,7 +707,7 @@ with &2 (update_last_trade) │ │ │ │ │ └── trade_request.tr_t_id:20 => tr_t_id:56 │ │ │ │ └── key: (56) │ │ │ └── projections - │ │ │ ├── 'SBMT' [as=column62:62] + │ │ │ ├── 'SBMT' [as=th_st_id_cast:62] │ │ │ └── '2020-06-15 22:27:42.148484' [as=timestamp:61] │ │ └── f-k-checks │ │ ├── f-k-checks-item: trade_history(th_t_id) -> trade(t_id) @@ -731,7 +731,7 @@ with &2 (update_last_trade) │ │ ├── with-scan &5 │ │ │ ├── columns: th_st_id:81!null │ │ │ ├── mapping: - │ │ │ │ └── column62:62 => th_st_id:81 + │ │ │ │ └── th_st_id_cast:62 => th_st_id:81 │ │ │ └── fd: ()-->(81) │ │ └── filters (true) │ └── projections @@ -750,12 +750,12 @@ with &2 (update_last_trade) │ │ ├── fetch columns: t_id:104 t_dts:105 trade.t_st_id:106 t_tt_id:107 t_is_cash:108 t_s_symb:109 t_qty:110 t_bid_price:111 t_ca_id:112 t_exec_name:113 t_trade_price:114 t_chrg:115 t_comm:116 t_lifo:118 │ │ ├── update-mapping: │ │ │ ├── t_dts_new:126 => t_dts:88 - │ │ │ └── column127:127 => trade.t_st_id:89 + │ │ │ └── t_st_id_cast:127 => trade.t_st_id:89 │ │ ├── input binding: &7 │ │ ├── volatile, mutations │ │ ├── key: (87) │ │ ├── project - │ │ │ ├── columns: column127:127!null t_dts_new:126!null t_id:104!null t_dts:105!null trade.t_st_id:106!null t_tt_id:107!null t_is_cash:108!null t_s_symb:109!null t_qty:110!null t_bid_price:111!null t_ca_id:112!null t_exec_name:113!null t_trade_price:114 t_chrg:115!null t_comm:116!null t_lifo:118!null + │ │ │ ├── columns: t_st_id_cast:127!null t_dts_new:126!null t_id:104!null t_dts:105!null trade.t_st_id:106!null t_tt_id:107!null t_is_cash:108!null t_s_symb:109!null t_qty:110!null t_bid_price:111!null t_ca_id:112!null t_exec_name:113!null t_trade_price:114 t_chrg:115!null t_comm:116!null t_lifo:118!null │ │ │ ├── key: (104) │ │ │ ├── fd: ()-->(126,127), (104)-->(105-116,118) │ │ │ ├── project @@ -775,7 +775,7 @@ with &2 (update_last_trade) │ │ │ │ │ └── key: (121) │ │ │ │ └── filters (true) │ │ │ └── projections - │ │ │ ├── 'SBMT' [as=column127:127] + │ │ │ ├── 'SBMT' [as=t_st_id_cast:127] │ │ │ └── '2020-06-15 22:27:42.148484' [as=t_dts_new:126] │ │ └── f-k-checks │ │ └── f-k-checks-item: trade(t_st_id) -> status_type(st_id) @@ -787,7 +787,7 @@ with &2 (update_last_trade) │ │ ├── with-scan &7 │ │ │ ├── columns: t_st_id:133!null │ │ │ ├── mapping: - │ │ │ │ └── column127:127 => t_st_id:133 + │ │ │ │ └── t_st_id_cast:127 => t_st_id:133 │ │ │ └── fd: ()-->(133) │ │ └── filters (true) │ └── projections @@ -2968,18 +2968,18 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:18 => t_id:1 │ │ │ ├── column2:19 => t_dts:2 - │ │ │ ├── column33:33 => trade.t_st_id:3 - │ │ │ ├── column34:34 => trade.t_tt_id:4 + │ │ │ ├── t_st_id_cast:33 => trade.t_st_id:3 + │ │ │ ├── t_tt_id_cast:34 => trade.t_tt_id:4 │ │ │ ├── column5:22 => t_is_cash:5 - │ │ │ ├── column35:35 => trade.t_s_symb:6 - │ │ │ ├── column36:36 => t_qty:7 - │ │ │ ├── column37:37 => t_bid_price:8 + │ │ │ ├── t_s_symb_cast:35 => trade.t_s_symb:6 + │ │ │ ├── t_qty_cast:36 => t_qty:7 + │ │ │ ├── t_bid_price_cast:37 => t_bid_price:8 │ │ │ ├── column9:26 => trade.t_ca_id:9 - │ │ │ ├── column38:38 => t_exec_name:10 + │ │ │ ├── t_exec_name_cast:38 => t_exec_name:10 │ │ │ ├── column11:28 => t_trade_price:11 - │ │ │ ├── column39:39 => t_chrg:12 - │ │ │ ├── column40:40 => t_comm:13 - │ │ │ ├── column41:41 => t_tax:14 + │ │ │ ├── t_chrg_cast:39 => t_chrg:12 + │ │ │ ├── t_comm_cast:40 => t_comm:13 + │ │ │ ├── t_tax_cast:41 => t_tax:14 │ │ │ └── column15:32 => t_lifo:15 │ │ ├── check columns: check1:42 check2:43 check3:44 check4:45 check5:46 │ │ ├── input binding: &1 @@ -2988,7 +2988,7 @@ with &2 (insert_trade) │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null column33:33!null column34:34!null column35:35!null column36:36!null column37:37!null column38:38!null column39:39!null column40:40!null column41:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null + │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null t_st_id_cast:33!null t_tt_id_cast:34!null t_s_symb_cast:35!null t_qty_cast:36!null t_bid_price_cast:37!null t_exec_name_cast:38!null t_chrg_cast:39!null t_comm_cast:40!null t_tax_cast:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(18,19,22,26,28,32-46) @@ -3005,7 +3005,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_st_id:47!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column33:33 => t_st_id:47 + │ │ │ │ │ └── t_st_id_cast:33 => t_st_id:47 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(47) @@ -3021,7 +3021,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_tt_id:52!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column34:34 => t_tt_id:52 + │ │ │ │ │ └── t_tt_id_cast:34 => t_tt_id:52 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(52) @@ -3037,7 +3037,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_s_symb:59!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column35:35 => t_s_symb:59 + │ │ │ │ │ └── t_s_symb_cast:35 => t_s_symb:59 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(59) @@ -3077,14 +3077,14 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:93 => trade_history.th_t_id:88 │ │ │ ├── column2:94 => th_dts:89 - │ │ │ └── column96:96 => trade_history.th_st_id:90 + │ │ │ └── th_st_id_cast:96 => trade_history.th_st_id:90 │ │ ├── input binding: &3 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(88,90) │ │ ├── values - │ │ │ ├── columns: column1:93!null column2:94!null column96:96!null + │ │ │ ├── columns: column1:93!null column2:94!null th_st_id_cast:96!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(93,94,96) @@ -3117,7 +3117,7 @@ with &2 (insert_trade) │ │ ├── with-scan &3 │ │ │ ├── columns: th_st_id:115!null │ │ │ ├── mapping: - │ │ │ │ └── column96:96 => th_st_id:115 + │ │ │ │ └── th_st_id_cast:96 => th_st_id:115 │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(115) @@ -3218,18 +3218,18 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:18 => t_id:1 │ │ │ ├── column2:19 => t_dts:2 - │ │ │ ├── column33:33 => trade.t_st_id:3 - │ │ │ ├── column34:34 => trade.t_tt_id:4 + │ │ │ ├── t_st_id_cast:33 => trade.t_st_id:3 + │ │ │ ├── t_tt_id_cast:34 => trade.t_tt_id:4 │ │ │ ├── column5:22 => t_is_cash:5 - │ │ │ ├── column35:35 => trade.t_s_symb:6 - │ │ │ ├── column36:36 => t_qty:7 - │ │ │ ├── column37:37 => t_bid_price:8 + │ │ │ ├── t_s_symb_cast:35 => trade.t_s_symb:6 + │ │ │ ├── t_qty_cast:36 => t_qty:7 + │ │ │ ├── t_bid_price_cast:37 => t_bid_price:8 │ │ │ ├── column9:26 => trade.t_ca_id:9 - │ │ │ ├── column38:38 => t_exec_name:10 + │ │ │ ├── t_exec_name_cast:38 => t_exec_name:10 │ │ │ ├── column11:28 => t_trade_price:11 - │ │ │ ├── column39:39 => t_chrg:12 - │ │ │ ├── column40:40 => t_comm:13 - │ │ │ ├── column41:41 => t_tax:14 + │ │ │ ├── t_chrg_cast:39 => t_chrg:12 + │ │ │ ├── t_comm_cast:40 => t_comm:13 + │ │ │ ├── t_tax_cast:41 => t_tax:14 │ │ │ └── column15:32 => t_lifo:15 │ │ ├── check columns: check1:42 check2:43 check3:44 check4:45 check5:46 │ │ ├── input binding: &1 @@ -3238,7 +3238,7 @@ with &2 (insert_trade) │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null column33:33!null column34:34!null column35:35!null column36:36!null column37:37!null column38:38!null column39:39!null column40:40!null column41:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null + │ │ │ ├── columns: column1:18!null column2:19!null column5:22!null column9:26!null column11:28 column15:32!null t_st_id_cast:33!null t_tt_id_cast:34!null t_s_symb_cast:35!null t_qty_cast:36!null t_bid_price_cast:37!null t_exec_name_cast:38!null t_chrg_cast:39!null t_comm_cast:40!null t_tax_cast:41!null check1:42!null check2:43!null check3:44!null check4:45!null check5:46!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(18,19,22,26,28,32-46) @@ -3255,7 +3255,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_st_id:47!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column33:33 => t_st_id:47 + │ │ │ │ │ └── t_st_id_cast:33 => t_st_id:47 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(47) @@ -3271,7 +3271,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_tt_id:52!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column34:34 => t_tt_id:52 + │ │ │ │ │ └── t_tt_id_cast:34 => t_tt_id:52 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(52) @@ -3287,7 +3287,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &1 │ │ │ │ ├── columns: t_s_symb:59!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column35:35 => t_s_symb:59 + │ │ │ │ │ └── t_s_symb_cast:35 => t_s_symb:59 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(59) @@ -3327,14 +3327,14 @@ with &2 (insert_trade) │ │ ├── insert-mapping: │ │ │ ├── column1:93 => trade_history.th_t_id:88 │ │ │ ├── column2:94 => th_dts:89 - │ │ │ └── column96:96 => trade_history.th_st_id:90 + │ │ │ └── th_st_id_cast:96 => trade_history.th_st_id:90 │ │ ├── input binding: &3 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(88,90) │ │ ├── values - │ │ │ ├── columns: column1:93!null column2:94!null column96:96!null + │ │ │ ├── columns: column1:93!null column2:94!null th_st_id_cast:96!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(93,94,96) @@ -3367,7 +3367,7 @@ with &2 (insert_trade) │ │ ├── with-scan &3 │ │ │ ├── columns: th_st_id:115!null │ │ │ ├── mapping: - │ │ │ │ └── column96:96 => th_st_id:115 + │ │ │ │ └── th_st_id_cast:96 => th_st_id:115 │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(115) @@ -3390,10 +3390,10 @@ with &2 (insert_trade) │ │ ├── columns: trade_request.tr_t_id:121!null │ │ ├── insert-mapping: │ │ │ ├── column1:129 => trade_request.tr_t_id:121 - │ │ │ ├── column135:135 => trade_request.tr_tt_id:122 - │ │ │ ├── column136:136 => trade_request.tr_s_symb:123 - │ │ │ ├── column137:137 => tr_qty:124 - │ │ │ ├── column138:138 => tr_bid_price:125 + │ │ │ ├── tr_tt_id_cast:135 => trade_request.tr_tt_id:122 + │ │ │ ├── tr_s_symb_cast:136 => trade_request.tr_s_symb:123 + │ │ │ ├── tr_qty_cast:137 => tr_qty:124 + │ │ │ ├── tr_bid_price_cast:138 => tr_bid_price:125 │ │ │ └── column6:134 => trade_request.tr_b_id:126 │ │ ├── check columns: check1:139 check2:140 │ │ ├── partial index put columns: partial_index_put1:141 @@ -3403,7 +3403,7 @@ with &2 (insert_trade) │ │ ├── key: () │ │ ├── fd: ()-->(121) │ │ ├── values - │ │ │ ├── columns: column1:129!null column6:134!null column135:135!null column136:136!null column137:137!null column138:138!null check1:139!null check2:140!null partial_index_put1:141!null + │ │ │ ├── columns: column1:129!null column6:134!null tr_tt_id_cast:135!null tr_s_symb_cast:136!null tr_qty_cast:137!null tr_bid_price_cast:138!null check1:139!null check2:140!null partial_index_put1:141!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(129,134-141) @@ -3436,7 +3436,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &5 │ │ │ │ ├── columns: tr_tt_id:160!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column135:135 => tr_tt_id:160 + │ │ │ │ │ └── tr_tt_id_cast:135 => tr_tt_id:160 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(160) @@ -3452,7 +3452,7 @@ with &2 (insert_trade) │ │ │ ├── with-scan &5 │ │ │ │ ├── columns: tr_s_symb:167!null │ │ │ │ ├── mapping: - │ │ │ │ │ └── column136:136 => tr_s_symb:167 + │ │ │ │ │ └── tr_s_symb_cast:136 => tr_s_symb:167 │ │ │ │ ├── cardinality: [1 - 1] │ │ │ │ ├── key: () │ │ │ │ └── fd: ()-->(167) @@ -3630,13 +3630,13 @@ insert holding_summary ├── columns: ├── insert-mapping: │ ├── column1:6 => holding_summary.hs_ca_id:1 - │ ├── column9:9 => holding_summary.hs_s_symb:2 - │ └── column10:10 => hs_qty:3 + │ ├── hs_s_symb_cast:9 => holding_summary.hs_s_symb:2 + │ └── hs_qty_cast:10 => hs_qty:3 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── values - │ ├── columns: column1:6!null column9:9!null column10:10!null + │ ├── columns: column1:6!null hs_s_symb_cast:9!null hs_qty_cast:10!null │ ├── cardinality: [1 - 1] │ ├── key: () │ ├── fd: ()-->(6,9,10) @@ -3669,7 +3669,7 @@ insert holding_summary ├── with-scan &1 │ ├── columns: hs_s_symb:20!null │ ├── mapping: - │ │ └── column9:9 => hs_s_symb:20 + │ │ └── hs_s_symb_cast:9 => hs_s_symb:20 │ ├── cardinality: [1 - 1] │ ├── key: () │ └── fd: ()-->(20) @@ -3685,11 +3685,11 @@ update holding_summary ├── columns: ├── fetch columns: hs_ca_id:6 hs_s_symb:7 hs_qty:8 ├── update-mapping: - │ └── column12:12 => hs_qty:3 + │ └── hs_qty_cast:12 => hs_qty:3 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column12:12!null hs_ca_id:6!null hs_s_symb:7!null hs_qty:8!null + ├── columns: hs_qty_cast:12!null hs_ca_id:6!null hs_s_symb:7!null hs_qty:8!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -3701,7 +3701,7 @@ update holding_summary │ ├── key: () │ └── fd: ()-->(6-8) └── projections - └── assignment-cast: INT4 [as=column12:12, outer=(8), immutable] + └── assignment-cast: INT4 [as=hs_qty_cast:12, outer=(8), immutable] └── hs_qty:8::INT8 + 10 # Q5 @@ -3816,11 +3816,11 @@ update holding ├── columns: ├── fetch columns: h_t_id:9 h_ca_id:10 h_s_symb:11 h_dts:12 h_price:13 h_qty:14 ├── update-mapping: - │ └── column18:18 => h_qty:6 + │ └── h_qty_cast:18 => h_qty:6 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column18:18!null h_t_id:9!null h_ca_id:10!null h_s_symb:11!null h_dts:12!null h_price:13!null h_qty:14!null + ├── columns: h_qty_cast:18!null h_t_id:9!null h_ca_id:10!null h_s_symb:11!null h_dts:12!null h_price:13!null h_qty:14!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -3832,7 +3832,7 @@ update holding │ ├── key: () │ └── fd: ()-->(9-14) └── projections - └── assignment-cast: INT4 [as=column18:18, outer=(14), immutable] + └── assignment-cast: INT4 [as=h_qty_cast:18, outer=(14), immutable] └── h_qty:14::INT8 + 10 # Q9 @@ -3870,16 +3870,16 @@ insert holding ├── insert-mapping: │ ├── column1:9 => holding.h_t_id:1 │ ├── column2:10 => holding.h_ca_id:2 - │ ├── column15:15 => holding.h_s_symb:3 + │ ├── h_s_symb_cast:15 => holding.h_s_symb:3 │ ├── column4:12 => h_dts:4 - │ ├── column16:16 => h_price:5 - │ └── column17:17 => h_qty:6 + │ ├── h_price_cast:16 => h_price:5 + │ └── h_qty_cast:17 => h_qty:6 ├── check columns: check1:18 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── values - │ ├── columns: column1:9!null column2:10!null column4:12!null column15:15!null column16:16!null column17:17!null check1:18!null + │ ├── columns: column1:9!null column2:10!null column4:12!null h_s_symb_cast:15!null h_price_cast:16!null h_qty_cast:17!null check1:18!null │ ├── cardinality: [1 - 1] │ ├── key: () │ ├── fd: ()-->(9,10,12,15-18) @@ -3913,7 +3913,7 @@ insert holding │ ├── columns: h_ca_id:37!null h_s_symb:38!null │ ├── mapping: │ │ ├── column2:10 => h_ca_id:37 - │ │ └── column15:15 => h_s_symb:38 + │ │ └── h_s_symb_cast:15 => h_s_symb:38 │ ├── cardinality: [1 - 1] │ ├── key: () │ └── fd: ()-->(37,38) @@ -3975,20 +3975,20 @@ project │ ├── columns: t_id:1!null trade.t_tax:14!null │ ├── fetch columns: t_id:18 trade.t_tax:31 │ ├── update-mapping: - │ │ └── column46:46 => trade.t_tax:14 + │ │ └── t_tax_cast:46 => trade.t_tax:14 │ ├── check columns: check5:51 │ ├── cardinality: [0 - 1] │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(1,14) │ └── project - │ ├── columns: check5:51 t_id:18!null trade.t_tax:31!null column46:46 + │ ├── columns: check5:51 t_id:18!null trade.t_tax:31!null t_tax_cast:46 │ ├── cardinality: [0 - 1] │ ├── immutable │ ├── key: () │ ├── fd: ()-->(18,31,46,51) │ ├── project - │ │ ├── columns: column46:46 t_id:18!null trade.t_tax:31!null + │ │ ├── columns: t_tax_cast:46 t_id:18!null trade.t_tax:31!null │ │ ├── cardinality: [0 - 1] │ │ ├── immutable │ │ ├── key: () @@ -4000,7 +4000,7 @@ project │ │ │ ├── key: () │ │ │ └── fd: ()-->(18,31) │ │ └── projections - │ │ └── assignment-cast: DECIMAL(10,2) [as=column46:46, immutable, subquery] + │ │ └── assignment-cast: DECIMAL(10,2) [as=t_tax_cast:46, immutable, subquery] │ │ └── mult │ │ ├── subquery │ │ │ └── scalar-group-by @@ -4025,7 +4025,7 @@ project │ │ │ └── tx_rate:37 │ │ └── 2E+1 │ └── projections - │ └── column46:46 >= 0 [as=check5:51, outer=(46), immutable] + │ └── t_tax_cast:46 >= 0 [as=check5:51, outer=(46), immutable] └── projections └── trade.t_tax:14::FLOAT8 [as=t_tax:52, outer=(14), immutable] @@ -4203,9 +4203,9 @@ with &2 (update_trade_commission) │ │ ├── fetch columns: t_id:18 t_dts:19 trade.t_st_id:20 t_tt_id:21 t_is_cash:22 t_s_symb:23 t_qty:24 t_bid_price:25 t_ca_id:26 t_exec_name:27 t_trade_price:28 t_chrg:29 t_comm:30 t_lifo:32 │ │ ├── update-mapping: │ │ │ ├── t_dts_new:36 => t_dts:2 - │ │ │ ├── column39:39 => trade.t_st_id:3 - │ │ │ ├── column40:40 => t_trade_price:11 - │ │ │ └── column41:41 => t_comm:13 + │ │ │ ├── t_st_id_cast:39 => trade.t_st_id:3 + │ │ │ ├── t_trade_price_cast:40 => t_trade_price:11 + │ │ │ └── t_comm_cast:41 => t_comm:13 │ │ ├── check columns: check4:45 │ │ ├── input binding: &1 │ │ ├── cardinality: [0 - 1] @@ -4213,7 +4213,7 @@ with &2 (update_trade_commission) │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── project - │ │ │ ├── columns: check4:45!null column41:41!null column39:39!null column40:40!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null + │ │ │ ├── columns: check4:45!null t_comm_cast:41!null t_st_id_cast:39!null t_trade_price_cast:40!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(18-30,32,36,39-41,45) @@ -4225,9 +4225,9 @@ with &2 (update_trade_commission) │ │ │ │ └── fd: ()-->(18-30,32) │ │ │ └── projections │ │ │ ├── true [as=check4:45] - │ │ │ ├── 50.00 [as=column41:41] - │ │ │ ├── 'ACTV' [as=column39:39] - │ │ │ ├── 100.00 [as=column40:40] + │ │ │ ├── 50.00 [as=t_comm_cast:41] + │ │ │ ├── 'ACTV' [as=t_st_id_cast:39] + │ │ │ ├── 100.00 [as=t_trade_price_cast:40] │ │ │ └── '2020-06-15 22:27:42.148484' [as=t_dts_new:36] │ │ └── f-k-checks │ │ └── f-k-checks-item: trade(t_st_id) -> status_type(st_id) @@ -4241,7 +4241,7 @@ with &2 (update_trade_commission) │ │ ├── with-scan &1 │ │ │ ├── columns: t_st_id:47!null │ │ │ ├── mapping: - │ │ │ │ └── column39:39 => t_st_id:47 + │ │ │ │ └── t_st_id_cast:39 => t_st_id:47 │ │ │ ├── cardinality: [0 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(47) @@ -4265,13 +4265,13 @@ with &2 (update_trade_commission) │ │ ├── fetch columns: b_id:60 b_num_trades:63 b_comm_total:64 │ │ ├── update-mapping: │ │ │ ├── b_num_trades_new:68 => b_num_trades:56 - │ │ │ └── column69:69 => b_comm_total:57 + │ │ │ └── b_comm_total_cast:69 => b_comm_total:57 │ │ ├── cardinality: [0 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(53) │ │ └── project - │ │ ├── columns: column69:69!null b_num_trades_new:68!null b_id:60!null b_num_trades:63!null b_comm_total:64!null + │ │ ├── columns: b_comm_total_cast:69!null b_num_trades_new:68!null b_id:60!null b_num_trades:63!null b_comm_total:64!null │ │ ├── cardinality: [0 - 1] │ │ ├── immutable │ │ ├── key: () @@ -4283,7 +4283,7 @@ with &2 (update_trade_commission) │ │ │ ├── key: () │ │ │ └── fd: ()-->(60,63,64) │ │ └── projections - │ │ ├── assignment-cast: DECIMAL(12,2) [as=column69:69, outer=(64), immutable] + │ │ ├── assignment-cast: DECIMAL(12,2) [as=b_comm_total_cast:69, outer=(64), immutable] │ │ │ └── b_comm_total:64::DECIMAL + 5E+1 │ │ └── b_num_trades:63 + 1 [as=b_num_trades_new:68, outer=(63), immutable] │ └── projections @@ -4305,14 +4305,14 @@ with &2 (update_trade_commission) │ │ ├── insert-mapping: │ │ │ ├── column1:76 => trade_history.th_t_id:71 │ │ │ ├── column2:77 => th_dts:72 - │ │ │ └── column79:79 => trade_history.th_st_id:73 + │ │ │ └── th_st_id_cast:79 => trade_history.th_st_id:73 │ │ ├── input binding: &5 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(71,73) │ │ ├── values - │ │ │ ├── columns: column1:76!null column2:77!null column79:79!null + │ │ │ ├── columns: column1:76!null column2:77!null th_st_id_cast:79!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(76,77,79) @@ -4345,7 +4345,7 @@ with &2 (update_trade_commission) │ │ ├── with-scan &5 │ │ │ ├── columns: th_st_id:98!null │ │ │ ├── mapping: - │ │ │ │ └── column79:79 => th_st_id:98 + │ │ │ │ └── th_st_id_cast:79 => th_st_id:98 │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ └── fd: ()-->(98) @@ -4401,16 +4401,16 @@ with &2 (insert_settlement) │ │ ├── columns: settlement.se_t_id:1!null │ │ ├── insert-mapping: │ │ │ ├── column1:7 => settlement.se_t_id:1 - │ │ │ ├── column11:11 => se_cash_type:2 + │ │ │ ├── se_cash_type_cast:11 => se_cash_type:2 │ │ │ ├── column3:9 => se_cash_due_date:3 - │ │ │ └── column12:12 => se_amt:4 + │ │ │ └── se_amt_cast:12 => se_amt:4 │ │ ├── input binding: &1 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:7!null column3:9!null column11:11!null column12:12!null + │ │ │ ├── columns: column1:7!null column3:9!null se_cash_type_cast:11!null se_amt_cast:12!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(7,9,11,12) @@ -4451,15 +4451,15 @@ with &2 (insert_settlement) │ │ ├── insert-mapping: │ │ │ ├── column1:38 => cash_transaction.ct_t_id:32 │ │ │ ├── column2:39 => ct_dts:33 - │ │ │ ├── column42:42 => ct_amt:34 - │ │ │ └── column43:43 => ct_name:35 + │ │ │ ├── ct_amt_cast:42 => ct_amt:34 + │ │ │ └── ct_name_cast:43 => ct_name:35 │ │ ├── input binding: &3 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(32) │ │ ├── values - │ │ │ ├── columns: column1:38!null column2:39!null column42:42!null column43:43!null + │ │ │ ├── columns: column1:38!null column2:39!null ct_amt_cast:42!null ct_name_cast:43!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(38,39,42,43) @@ -4493,13 +4493,13 @@ with &2 (insert_settlement) │ ├── columns: ca_id:63!null customer_account.ca_bal:68!null │ ├── fetch columns: ca_id:71 ca_b_id:72 ca_c_id:73 ca_name:74 ca_tax_st:75 customer_account.ca_bal:76 │ ├── update-mapping: - │ │ └── column80:80 => customer_account.ca_bal:68 + │ │ └── ca_bal_cast:80 => customer_account.ca_bal:68 │ ├── cardinality: [0 - 1] │ ├── volatile, mutations │ ├── key: () │ ├── fd: ()-->(63,68) │ └── project - │ ├── columns: column80:80!null ca_id:71!null ca_b_id:72!null ca_c_id:73!null ca_name:74 ca_tax_st:75!null customer_account.ca_bal:76!null + │ ├── columns: ca_bal_cast:80!null ca_id:71!null ca_b_id:72!null ca_c_id:73!null ca_name:74 ca_tax_st:75!null customer_account.ca_bal:76!null │ ├── cardinality: [0 - 1] │ ├── immutable │ ├── key: () @@ -4511,7 +4511,7 @@ with &2 (insert_settlement) │ │ ├── key: () │ │ └── fd: ()-->(71-76) │ └── projections - │ └── assignment-cast: DECIMAL(12,2) [as=column80:80, outer=(76), immutable] + │ └── assignment-cast: DECIMAL(12,2) [as=ca_bal_cast:80, outer=(76), immutable] │ └── customer_account.ca_bal:76::DECIMAL + 1E+2 └── projections └── customer_account.ca_bal:68::FLOAT8 [as=ca_bal:82, outer=(68), immutable] @@ -4543,16 +4543,16 @@ with &2 (insert_settlement) │ │ ├── columns: settlement.se_t_id:1!null │ │ ├── insert-mapping: │ │ │ ├── column1:7 => settlement.se_t_id:1 - │ │ │ ├── column11:11 => se_cash_type:2 + │ │ │ ├── se_cash_type_cast:11 => se_cash_type:2 │ │ │ ├── column3:9 => se_cash_due_date:3 - │ │ │ └── column12:12 => se_amt:4 + │ │ │ └── se_amt_cast:12 => se_amt:4 │ │ ├── input binding: &1 │ │ ├── cardinality: [1 - 1] │ │ ├── volatile, mutations │ │ ├── key: () │ │ ├── fd: ()-->(1) │ │ ├── values - │ │ │ ├── columns: column1:7!null column3:9!null column11:11!null column12:12!null + │ │ │ ├── columns: column1:7!null column3:9!null se_cash_type_cast:11!null se_amt_cast:12!null │ │ │ ├── cardinality: [1 - 1] │ │ │ ├── key: () │ │ │ ├── fd: ()-->(7,9,11,12) @@ -5071,11 +5071,11 @@ update trade ├── columns: ├── fetch columns: t_id:18 t_dts:19 t_st_id:20 t_tt_id:21 t_is_cash:22 t_s_symb:23 t_qty:24 t_bid_price:25 t_ca_id:26 t_exec_name:27 t_trade_price:28 t_chrg:29 t_comm:30 t_lifo:32 ├── update-mapping: - │ └── column36:36 => t_exec_name:10 + │ └── t_exec_name_cast:36 => t_exec_name:10 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column36:36 t_id:18!null t_dts:19!null t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null + ├── columns: t_exec_name_cast:36 t_id:18!null t_dts:19!null t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null ├── cardinality: [0 - 4] ├── immutable ├── key: (18) @@ -5087,7 +5087,7 @@ update trade │ ├── key: (18) │ └── fd: (18)-->(19-30,32) └── projections - └── assignment-cast: VARCHAR(49) [as=column36:36, outer=(27), immutable] + └── assignment-cast: VARCHAR(49) [as=t_exec_name_cast:36, outer=(27), immutable] └── CASE t_exec_name:27 LIKE '% X %' WHEN true THEN replace(t_exec_name:27, ' X ', ' ') ELSE replace(t_exec_name:27, ' ', ' X ') END # Q3 @@ -5257,11 +5257,11 @@ update settlement ├── columns: ├── fetch columns: se_t_id:7 se_cash_type:8 se_cash_due_date:9 se_amt:10 ├── update-mapping: - │ └── column16:16 => se_cash_type:2 + │ └── se_cash_type_cast:16 => se_cash_type:2 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column16:16!null se_t_id:7!null se_cash_type:8!null se_cash_due_date:9!null se_amt:10!null unnest:13!null unnest:14!null + ├── columns: se_cash_type_cast:16!null se_t_id:7!null se_cash_type:8!null se_cash_due_date:9!null se_amt:10!null unnest:13!null unnest:14!null ├── cardinality: [0 - 4] ├── immutable ├── key: (7) @@ -5298,7 +5298,7 @@ update settlement │ └── first-agg [as=unnest:14, outer=(14)] │ └── unnest:14 └── projections - └── assignment-cast: VARCHAR(40) [as=column16:16, outer=(8,14), immutable] + └── assignment-cast: VARCHAR(40) [as=se_cash_type_cast:16, outer=(8,14), immutable] └── CASE unnest:14 WHEN true THEN CASE se_cash_type:8 = 'Cash Account' WHEN true THEN 'Cash' ELSE 'Cash Account' END ELSE CASE se_cash_type:8 = 'Margin Account' WHEN true THEN 'Margin' ELSE 'Margin Account' END END # Q6 @@ -5522,11 +5522,11 @@ update cash_transaction ├── columns: ├── fetch columns: ct_t_id:7 ct_dts:8 ct_amt:9 ct_name:10 ├── update-mapping: - │ └── column18:18 => ct_name:4 + │ └── ct_name_cast:18 => ct_name:4 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column18:18 ct_t_id:7!null ct_dts:8!null ct_amt:9!null ct_name:10 unnest:13!null unnest:14!null unnest:15!null unnest:16!null + ├── columns: ct_name_cast:18 ct_t_id:7!null ct_dts:8!null ct_amt:9!null ct_name:10 unnest:13!null unnest:14!null unnest:15!null unnest:16!null ├── cardinality: [0 - 4] ├── immutable ├── key: (7) @@ -5567,7 +5567,7 @@ update cash_transaction │ └── first-agg [as=unnest:16, outer=(16)] │ └── unnest:16 └── projections - └── assignment-cast: VARCHAR(100) [as=column18:18, outer=(10,14-16), immutable] + └── assignment-cast: VARCHAR(100) [as=ct_name_cast:18, outer=(10,14-16), immutable] └── concat_ws(' ', unnest:14, unnest:15::STRING, CASE ct_name:10 LIKE '% shares of %' WHEN true THEN 'Shares of' ELSE 'shares of' END, unnest:16) # -------------------------------------------------- @@ -5610,11 +5610,11 @@ update account_permission ├── columns: ├── fetch columns: ap_ca_id:8 ap_acl:9 ap_tax_id:10 ap_l_name:11 ap_f_name:12 ├── update-mapping: - │ └── column16:16 => ap_acl:2 + │ └── ap_acl_cast:16 => ap_acl:2 ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: ap_ca_id:8!null ap_acl:9!null ap_tax_id:10!null ap_l_name:11!null ap_f_name:12!null column16:16!null + ├── columns: ap_ca_id:8!null ap_acl:9!null ap_tax_id:10!null ap_l_name:11!null ap_f_name:12!null ap_acl_cast:16!null ├── cardinality: [0 - 0] ├── key: () └── fd: ()-->(8-12,16) @@ -5679,11 +5679,11 @@ update address ├── columns: ├── fetch columns: ad_id:8 ad_line1:9 ad_line2:10 ad_zc_code:11 ad_ctry:12 ├── update-mapping: - │ └── column16:16 => ad_line2:3 + │ └── ad_line2_cast:16 => ad_line2:3 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column16:16!null ad_id:8!null ad_line1:9 ad_line2:10 ad_zc_code:11!null ad_ctry:12 + ├── columns: ad_line2_cast:16!null ad_id:8!null ad_line1:9 ad_line2:10 ad_zc_code:11!null ad_ctry:12 ├── cardinality: [0 - 1] ├── key: () ├── fd: ()-->(8-12,16) @@ -5694,7 +5694,7 @@ update address │ ├── key: () │ └── fd: ()-->(8-12) └── projections - └── '' [as=column16:16] + └── '' [as=ad_line2_cast:16] # Q6 opt @@ -5704,11 +5704,11 @@ update company ├── columns: ├── fetch columns: co_id:12 co_st_id:13 co_name:14 co_in_id:15 co_sp_rate:16 co_ceo:17 co_ad_id:18 co_desc:19 co_open_date:20 ├── update-mapping: - │ └── column24:24 => co_sp_rate:5 + │ └── co_sp_rate_cast:24 => co_sp_rate:5 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column24:24!null co_id:12!null co_st_id:13!null co_name:14!null co_in_id:15!null co_sp_rate:16!null co_ceo:17!null co_ad_id:18!null co_desc:19!null co_open_date:20!null + ├── columns: co_sp_rate_cast:24!null co_id:12!null co_st_id:13!null co_name:14!null co_in_id:15!null co_sp_rate:16!null co_ceo:17!null co_ad_id:18!null co_desc:19!null co_open_date:20!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -5720,7 +5720,7 @@ update company │ ├── key: () │ └── fd: ()-->(12-20) └── projections - └── assignment-cast: VARCHAR(4) [as=column24:24, outer=(16), immutable] + └── assignment-cast: VARCHAR(4) [as=co_sp_rate_cast:24, outer=(16), immutable] └── CASE co_sp_rate:16 != 'ABA' WHEN true THEN 'ABA' ELSE 'AAA' END # Q7 @@ -5734,11 +5734,11 @@ update customer ├── columns: ├── fetch columns: c_id:27 c_tax_id:28 c_st_id:29 c_l_name:30 c_f_name:31 c_m_name:32 c_gndr:33 c_tier:34 c_dob:35 c_ad_id:36 c_ctry_1:37 c_area_1:38 c_local_1:39 c_ext_1:40 c_ctry_2:41 c_area_2:42 c_local_2:43 c_ext_2:44 c_ctry_3:45 c_area_3:46 c_local_3:47 c_ext_3:48 c_email_1:49 c_email_2:50 ├── update-mapping: - │ └── column54:54 => c_email_2:24 + │ └── c_email_2_cast:54 => c_email_2:24 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column54:54 c_id:27!null c_tax_id:28!null c_st_id:29!null c_l_name:30!null c_f_name:31!null c_m_name:32 c_gndr:33 c_tier:34!null c_dob:35!null c_ad_id:36!null c_ctry_1:37 c_area_1:38 c_local_1:39 c_ext_1:40 c_ctry_2:41 c_area_2:42 c_local_2:43 c_ext_2:44 c_ctry_3:45 c_area_3:46 c_local_3:47 c_ext_3:48 c_email_1:49 c_email_2:50 + ├── columns: c_email_2_cast:54 c_id:27!null c_tax_id:28!null c_st_id:29!null c_l_name:30!null c_f_name:31!null c_m_name:32 c_gndr:33 c_tier:34!null c_dob:35!null c_ad_id:36!null c_ctry_1:37 c_area_1:38 c_local_1:39 c_ext_1:40 c_ctry_2:41 c_area_2:42 c_local_2:43 c_ext_2:44 c_ctry_3:45 c_area_3:46 c_local_3:47 c_ext_3:48 c_email_1:49 c_email_2:50 ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -5750,7 +5750,7 @@ update customer │ ├── key: () │ └── fd: ()-->(27-50) └── projections - └── assignment-cast: VARCHAR(50) [as=column54:54, outer=(50), immutable] + └── assignment-cast: VARCHAR(50) [as=c_email_2_cast:54, outer=(50), immutable] └── left(c_email_2:50, strpos(c_email_2:50, '@')) || CASE c_email_2:50 LIKE '%@mindspring.com' WHEN true THEN 'earthlink.com' ELSE 'mindspring.com' END # Q8 @@ -5775,12 +5775,12 @@ update customer_taxrate ├── columns: ├── fetch columns: customer_taxrate.cx_tx_id:5 cx_c_id:6 ├── update-mapping: - │ └── column10:10 => customer_taxrate.cx_tx_id:1 + │ └── cx_tx_id_cast:10 => customer_taxrate.cx_tx_id:1 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: column10:10 customer_taxrate.cx_tx_id:5!null cx_c_id:6!null + │ ├── columns: cx_tx_id_cast:10 customer_taxrate.cx_tx_id:5!null cx_c_id:6!null │ ├── immutable │ ├── key: (5) │ ├── fd: ()-->(6), (5)-->(10) @@ -5792,7 +5792,7 @@ update customer_taxrate │ │ ├── key: (5) │ │ └── fd: ()-->(6) │ └── projections - │ └── assignment-cast: VARCHAR(4) [as=column10:10, outer=(5), immutable] + │ └── assignment-cast: VARCHAR(4) [as=cx_tx_id_cast:10, outer=(5), immutable] │ └── CASE left(customer_taxrate.cx_tx_id:5, 2) = 'US' WHEN true THEN CASE customer_taxrate.cx_tx_id:5 = 'US5' WHEN true THEN 'US1' ELSE 'US' || (right(customer_taxrate.cx_tx_id:5, 1)::INT8 + 1)::STRING END ELSE CASE customer_taxrate.cx_tx_id:5 = 'CN4' WHEN true THEN 'CN1' ELSE 'CN' || (right(customer_taxrate.cx_tx_id:5, 1)::INT8 + 1)::STRING END END └── f-k-checks └── f-k-checks-item: customer_taxrate(cx_tx_id) -> taxrate(tx_id) @@ -5803,7 +5803,7 @@ update customer_taxrate ├── with-scan &1 │ ├── columns: cx_tx_id:11 │ └── mapping: - │ └── column10:10 => cx_tx_id:11 + │ └── cx_tx_id_cast:10 => cx_tx_id:11 └── filters (true) # Q9 @@ -5853,11 +5853,11 @@ update exchange ├── columns: ├── fetch columns: ex_id:10 ex_name:11 ex_num_symb:12 ex_open:13 ex_close:14 ex_desc:15 ex_ad_id:16 ├── update-mapping: - │ └── column20:20 => ex_desc:6 + │ └── ex_desc_cast:20 => ex_desc:6 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column20:20 ex_id:10!null ex_name:11!null ex_num_symb:12!null ex_open:13!null ex_close:14!null ex_desc:15 ex_ad_id:16!null + ├── columns: ex_desc_cast:20 ex_id:10!null ex_name:11!null ex_num_symb:12!null ex_open:13!null ex_close:14!null ex_desc:15 ex_ad_id:16!null ├── immutable ├── key: (10) ├── fd: (10)-->(11-16), (15)-->(20) @@ -5866,7 +5866,7 @@ update exchange │ ├── key: (10) │ └── fd: (10)-->(11-16) └── projections - └── assignment-cast: VARCHAR(150) [as=column20:20, outer=(15), immutable] + └── assignment-cast: VARCHAR(150) [as=ex_desc_cast:20, outer=(15), immutable] └── CASE ex_desc:15 NOT LIKE '%LAST UPDATED%' WHEN true THEN (ex_desc:15::STRING || ' LAST UPDATED ') || '2017-05-10 13:00:00' ELSE substring(ex_desc:15, 1, length(ex_desc:15) - 19) || '2017-05-10 13:00:00' END # Q11 @@ -5980,11 +5980,11 @@ update taxrate ├── columns: ├── fetch columns: tx_id:6 tx_name:7 tx_rate:8 ├── update-mapping: - │ └── column12:12 => tx_name:2 + │ └── tx_name_cast:12 => tx_name:2 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column12:12 tx_id:6!null tx_name:7!null tx_rate:8!null + ├── columns: tx_name_cast:12 tx_id:6!null tx_name:7!null tx_rate:8!null ├── cardinality: [0 - 1] ├── immutable ├── key: () @@ -5996,7 +5996,7 @@ update taxrate │ ├── key: () │ └── fd: ()-->(6-8) └── projections - └── assignment-cast: VARCHAR(50) [as=column12:12, outer=(7), immutable] + └── assignment-cast: VARCHAR(50) [as=tx_name_cast:12, outer=(7), immutable] └── CASE tx_name:7 LIKE '% Tax %' WHEN true THEN replace(tx_name:7, ' Tax ', ' tax ') ELSE replace(tx_name:7, ' tax ', ' Tax ') END # Q15 @@ -6123,12 +6123,12 @@ update watch_item ├── columns: ├── fetch columns: wi_wl_id:5 watch_item.wi_s_symb:6 ├── update-mapping: - │ └── column14:14 => watch_item.wi_s_symb:2 + │ └── wi_s_symb_cast:14 => watch_item.wi_s_symb:2 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: column14:14!null wi_wl_id:5!null watch_item.wi_s_symb:6!null wl_id:9!null wl_c_id:10!null watch_list.crdb_internal_mvcc_timestamp:11 watch_list.tableoid:12 + │ ├── columns: wi_s_symb_cast:14!null wi_wl_id:5!null watch_item.wi_s_symb:6!null wl_id:9!null wl_c_id:10!null watch_list.crdb_internal_mvcc_timestamp:11 watch_list.tableoid:12 │ ├── key: (9) │ ├── fd: ()-->(6,10,14), (9)-->(11,12), (5)==(9), (9)==(5) │ ├── inner-join (lookup watch_item) @@ -6154,7 +6154,7 @@ update watch_item │ │ │ └── 'ROACH' [as="lookup_join_const_col_@6":35] │ │ └── filters (true) │ └── projections - │ └── 'ROACH' [as=column14:14] + │ └── 'ROACH' [as=wi_s_symb_cast:14] └── f-k-checks └── f-k-checks-item: watch_item(wi_s_symb) -> security(s_symb) └── anti-join (lookup security) @@ -6165,7 +6165,7 @@ update watch_item ├── with-scan &1 │ ├── columns: wi_s_symb:15!null │ ├── mapping: - │ │ └── column14:14 => wi_s_symb:15 + │ │ └── wi_s_symb_cast:14 => wi_s_symb:15 │ └── fd: ()-->(15) └── filters (true) @@ -6251,12 +6251,12 @@ update trade ├── fetch columns: t_id:18 t_dts:19 trade.t_st_id:20 t_tt_id:21 t_is_cash:22 t_s_symb:23 t_qty:24 t_bid_price:25 t_ca_id:26 t_exec_name:27 t_trade_price:28 t_chrg:29 t_comm:30 t_lifo:32 ├── update-mapping: │ ├── t_dts_new:36 => t_dts:2 - │ └── column37:37 => trade.t_st_id:3 + │ └── t_st_id_cast:37 => trade.t_st_id:3 ├── input binding: &1 ├── cardinality: [0 - 0] ├── volatile, mutations ├── project - │ ├── columns: column37:37!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null + │ ├── columns: t_st_id_cast:37!null t_dts_new:36!null t_id:18!null t_dts:19!null trade.t_st_id:20!null t_tt_id:21!null t_is_cash:22!null t_s_symb:23!null t_qty:24!null t_bid_price:25!null t_ca_id:26!null t_exec_name:27!null t_trade_price:28 t_chrg:29!null t_comm:30!null t_lifo:32!null │ ├── cardinality: [0 - 5] │ ├── key: (18) │ ├── fd: ()-->(36,37), (18)-->(19-30,32) @@ -6267,7 +6267,7 @@ update trade │ │ ├── key: (18) │ │ └── fd: (18)-->(19-30,32) │ └── projections - │ ├── 'PNDG' [as=column37:37] + │ ├── 'PNDG' [as=t_st_id_cast:37] │ └── '2020-06-15 22:27:42.148484' [as=t_dts_new:36] └── f-k-checks └── f-k-checks-item: trade(t_st_id) -> status_type(st_id) @@ -6280,7 +6280,7 @@ update trade ├── with-scan &1 │ ├── columns: t_st_id:43!null │ ├── mapping: - │ │ └── column37:37 => t_st_id:43 + │ │ └── t_st_id_cast:37 => t_st_id:43 │ ├── cardinality: [0 - 5] │ └── fd: ()-->(43) └── filters (true) diff --git a/pkg/sql/opt/xform/testdata/external/trading b/pkg/sql/opt/xform/testdata/external/trading index 29a721e5ea2b..ca67b237c730 100644 --- a/pkg/sql/opt/xform/testdata/external/trading +++ b/pkg/sql/opt/xform/testdata/external/trading @@ -1245,14 +1245,14 @@ insert transactions │ ├── column1:10 => dealerid:1 │ ├── column2:11 => isbuy:2 │ ├── column3:12 => date:3 - │ ├── column16:16 => accountname:4 - │ ├── column17:17 => customername:5 + │ ├── accountname_cast:16 => accountname:4 + │ ├── customername_cast:17 => customername:5 │ ├── column6:15 => operationid:6 │ └── version_default:18 => version:7 ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: column1:10!null column2:11!null column3:12!null column6:15!null column16:16!null column17:17!null version_default:18 + ├── columns: column1:10!null column2:11!null column3:12!null column6:15!null accountname_cast:16!null customername_cast:17!null version_default:18 ├── cardinality: [1 - 1] ├── volatile ├── key: () diff --git a/pkg/sql/opt/xform/testdata/external/trading-mutation b/pkg/sql/opt/xform/testdata/external/trading-mutation index f37383a637d5..1a04ce2ec3d7 100644 --- a/pkg/sql/opt/xform/testdata/external/trading-mutation +++ b/pkg/sql/opt/xform/testdata/external/trading-mutation @@ -1249,15 +1249,15 @@ insert transactions │ ├── column1:12 => dealerid:1 │ ├── column2:13 => isbuy:2 │ ├── column3:14 => date:3 - │ ├── column18:18 => accountname:4 - │ ├── column19:19 => customername:5 + │ ├── accountname_cast:18 => accountname:4 + │ ├── customername_cast:19 => customername:5 │ ├── column6:17 => operationid:6 │ ├── version_default:20 => version:7 │ └── olddate_default:21 => olddate:8 ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: column1:12!null column2:13!null column3:14!null column6:17!null column18:18!null column19:19!null version_default:20 olddate_default:21!null + ├── columns: column1:12!null column2:13!null column3:14!null column6:17!null accountname_cast:18!null customername_cast:19!null version_default:20 olddate_default:21!null ├── cardinality: [1 - 1] ├── volatile ├── key: () @@ -1480,13 +1480,13 @@ update cardsinfo [as=ci] ├── fetch columns: ci.dealerid:21 ci.cardid:22 buyprice:23 sellprice:24 discount:25 desiredinventory:26 actualinventory:27 maxinventory:28 ci.version:29 discountbuyprice:30 notes:31 oldinventory:32 ci.extra:33 ├── update-mapping: │ ├── actualinventory_new:49 => actualinventory:12 - │ ├── column53:53 => discountbuyprice:15 + │ ├── discountbuyprice_cast:53 => discountbuyprice:15 │ ├── notes_default:50 => notes:16 │ └── oldinventory_default:51 => oldinventory:17 ├── cardinality: [0 - 0] ├── volatile, mutations └── project - ├── columns: column53:53!null notes_default:50 oldinventory_default:51!null actualinventory_new:49 ci.dealerid:21!null ci.cardid:22!null buyprice:23!null sellprice:24!null discount:25!null desiredinventory:26!null actualinventory:27!null maxinventory:28!null ci.version:29!null discountbuyprice:30 notes:31 oldinventory:32 ci.extra:33 c:36!null q:37!null + ├── columns: discountbuyprice_cast:53!null notes_default:50 oldinventory_default:51!null actualinventory_new:49 ci.dealerid:21!null ci.cardid:22!null buyprice:23!null sellprice:24!null discount:25!null desiredinventory:26!null actualinventory:27!null maxinventory:28!null ci.version:29!null discountbuyprice:30 notes:31 oldinventory:32 ci.extra:33 c:36!null q:37!null ├── immutable ├── key: (22) ├── fd: ()-->(21,50,51), (22)-->(23-33,36,37,49,53), (29)-->(22-28,30-33), (22)==(36), (36)==(22) @@ -1592,7 +1592,7 @@ update cardsinfo [as=ci] │ └── const-agg [as=q:37, outer=(37)] │ └── q:37 └── projections - ├── assignment-cast: DECIMAL(10,4) [as=column53:53, outer=(23,25), immutable] + ├── assignment-cast: DECIMAL(10,4) [as=discountbuyprice_cast:53, outer=(23,25), immutable] │ └── buyprice:23::DECIMAL - discount:25::DECIMAL ├── CAST(NULL AS STRING) [as=notes_default:50] ├── 0 [as=oldinventory_default:51] diff --git a/pkg/sql/opt/xform/testdata/external/ycsb b/pkg/sql/opt/xform/testdata/external/ycsb index 0103c5163dd0..c446896cbed0 100644 --- a/pkg/sql/opt/xform/testdata/external/ycsb +++ b/pkg/sql/opt/xform/testdata/external/ycsb @@ -93,7 +93,7 @@ INSERT INTO usertable VALUES ( insert usertable ├── columns: ├── insert-mapping: - │ ├── column25:25 => ycsb_key:1 + │ ├── ycsb_key_cast:25 => ycsb_key:1 │ ├── column2:15 => field0:2 │ ├── column3:16 => field1:3 │ ├── column4:17 => field2:4 @@ -107,7 +107,7 @@ insert usertable ├── cardinality: [0 - 0] ├── volatile, mutations └── values - ├── columns: column2:15!null column3:16!null column4:17!null column5:18!null column6:19!null column7:20!null column8:21!null column9:22!null column10:23!null column11:24!null column25:25!null + ├── columns: column2:15!null column3:16!null column4:17!null column5:18!null column6:19!null column7:20!null column8:21!null column9:22!null column10:23!null column11:24!null ycsb_key_cast:25!null ├── cardinality: [1 - 1] ├── key: () ├── fd: ()-->(15-25)