Skip to content

Commit f7c6eb1

Browse files
committed
fix: improve error message for struct casting with mismatched field counts in SQL logic test
1 parent 8900fad commit f7c6eb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datafusion/sqllogictest/test_files/struct.slt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ SELECT CAST({a: 1, b: 2, extra: 3} AS STRUCT(a INT, b INT));
841841
----
842842
{a: 1, b: 2}
843843

844-
# Test no overlap with mismatched field count
845-
query error DataFusion error: (Plan error|Error during planning): Cannot cast struct with 3 fields to 2 fields without name overlap; positional mapping is ambiguous
844+
# Test no overlap with mismatched field count - should fail because no field names match
845+
statement error DataFusion error: (Plan error|Error during planning|This feature is not implemented): (Cannot cast struct: at least one field name must match between source and target|Cannot cast struct with 3 fields to 2 fields without name overlap|Unsupported CAST from Struct)
846846
SELECT CAST(struct(1, 'x', 'y') AS STRUCT(a INT, b VARCHAR));
847847

848848
# Test nested struct with field reordering

0 commit comments

Comments
 (0)