diff --git a/src/frontend/planner_test/tests/testdata/input/cast.yaml b/src/frontend/planner_test/tests/testdata/input/cast.yaml index a21b9e3cb409..a1e164e2ad23 100644 --- a/src/frontend/planner_test/tests/testdata/input/cast.yaml +++ b/src/frontend/planner_test/tests/testdata/input/cast.yaml @@ -64,3 +64,20 @@ select count(*) FILTER(WHERE 'y') from t; expected_outputs: - batch_plan +- name: nested type cast error message (array) + sql: | + select '[]'::int[]::bytea[]; + expected_outputs: + - binder_error +- name: nested type cast error message (struct) + sql: | + create table t (v struct, c bool>); + select v::struct, f bool> from t; + expected_outputs: + - binder_error +- name: nested type cast error message (map) + sql: | + create table t (v map(int, int)); + select v::map(int, bytea) from t; + expected_outputs: + - binder_error diff --git a/src/frontend/planner_test/tests/testdata/output/array.yaml b/src/frontend/planner_test/tests/testdata/output/array.yaml index a2b9486fdb33..259a727d23df 100644 --- a/src/frontend/planner_test/tests/testdata/output/array.yaml +++ b/src/frontend/planner_test/tests/testdata/output/array.yaml @@ -228,7 +228,7 @@ sql: | create table t (v1 varchar[]); insert into t values ('{c,' || 'd}'); - binder_error: 'Bind error: cannot cast type "character varying" to "character varying[]" in Assign context' + binder_error: cannot cast type "character varying" to "character varying[]" in Assign context - name: string to varchar[] in explicit context sql: | select ('{c,' || 'd}')::varchar[]; diff --git a/src/frontend/planner_test/tests/testdata/output/cast.yaml b/src/frontend/planner_test/tests/testdata/output/cast.yaml index 636f25a9b07d..5058cfb4f6ee 100644 --- a/src/frontend/planner_test/tests/testdata/output/cast.yaml +++ b/src/frontend/planner_test/tests/testdata/output/cast.yaml @@ -80,3 +80,35 @@ └─BatchExchange { order: [], dist: Single } └─BatchSimpleAgg { aggs: [count] } └─BatchScan { table: t, columns: [], distribution: SomeShard } +- name: nested type cast error message (array) + sql: | + select '[]'::int[]::bytea[]; + binder_error: | + Failed to bind expression: CAST(CAST('[]' AS INT[]) AS BYTEA[]) + + Caused by these errors (recent errors listed first): + 1: cannot cast type "integer[]" to "bytea[]" in Explicit context + 2: cannot cast type "integer" to "bytea" in Explicit context +- name: nested type cast error message (struct) + sql: | + create table t (v struct, c bool>); + select v::struct, f bool> from t; + binder_error: | + Failed to bind expression: CAST(v AS STRUCT, f BOOLEAN>) + + Caused by these errors (recent errors listed first): + 1: cannot cast type "struct, c boolean>" to "struct, f boolean>" in Explicit context + 2: cannot cast type "struct" to "struct" in Explicit context + 3: cannot cast type "integer" to "bytea" in Explicit context +- name: nested type cast error message (map) + sql: | + create table t (v map(int, int)); + select v::map(int, bytea) from t; + binder_error: | + Failed to bind expression: CAST(v AS MAP(INT,BYTEA)) + + Caused by these errors (recent errors listed first): + 1: cannot cast type "map(integer,integer)" to "map(integer,bytea)" in Explicit context + 2: cannot cast type "struct[]" to "struct[]" in Explicit context + 3: cannot cast type "struct" to "struct" in Explicit context + 4: cannot cast type "integer" to "bytea" in Explicit context diff --git a/src/frontend/planner_test/tests/testdata/output/expr.yaml b/src/frontend/planner_test/tests/testdata/output/expr.yaml index eacab421069a..ce2f86ed2e68 100644 --- a/src/frontend/planner_test/tests/testdata/output/expr.yaml +++ b/src/frontend/planner_test/tests/testdata/output/expr.yaml @@ -304,7 +304,7 @@ Failed to bind expression: concat_ws(v1, 1.2) Caused by: - Bind error: cannot cast type "integer" to "character varying" in Implicit context + cannot cast type "integer" to "character varying" in Implicit context - sql: | create table t (v1 int); select concat_ws() from t; diff --git a/src/frontend/planner_test/tests/testdata/output/struct_query.yaml b/src/frontend/planner_test/tests/testdata/output/struct_query.yaml index 907aa209c6d2..3f6b4579e44c 100644 --- a/src/frontend/planner_test/tests/testdata/output/struct_query.yaml +++ b/src/frontend/planner_test/tests/testdata/output/struct_query.yaml @@ -421,7 +421,7 @@ - sql: | CREATE TABLE a (c STRUCT, j INTEGER>); INSERT INTO a VALUES (1); - binder_error: 'Bind error: cannot cast type "integer" to "struct, j integer>" in Assign context' + binder_error: cannot cast type "integer" to "struct, j integer>" in Assign context - name: test struct type alignment in CASE expression sql: | select CASE WHEN false THEN ROW(0, INTERVAL '1') WHEN true THEN ROW(1.1, INTERVAL '1') ELSE ROW(1, INTERVAL '1') END; diff --git a/src/frontend/planner_test/tests/testdata/output/update.yaml b/src/frontend/planner_test/tests/testdata/output/update.yaml index 4a12b492660a..26c6d52dc5e0 100644 --- a/src/frontend/planner_test/tests/testdata/output/update.yaml +++ b/src/frontend/planner_test/tests/testdata/output/update.yaml @@ -11,7 +11,7 @@ - sql: | create table t (v1 int, v2 int); update t set v1 = true; - binder_error: 'Bind error: cannot cast type "boolean" to "integer" in Assign context' + binder_error: cannot cast type "boolean" to "integer" in Assign context - sql: | create table t (v1 int, v2 int); update t set v1 = v2 + 1;