adriangb commented on code in PR #27524:
URL: https://github.com/apache/datafusion/pull/27524#discussion_r4611095811


##########
datafusion/sql/tests/cases/plan_to_sql.rs:
##########
@@ -2300,6 +2239,28 @@ fn test_cast_to_tinyint() -> Result<(), DataFusionError> 
{
     Ok(())
 }
 
+#[test]
+fn test_cast_to_array() -> Result<(), DataFusionError> {
+    roundtrip_statement_with_dialect_helper!(
+        sql: "select cast(NULL as text[])",
+        parser_dialect: GenericDialect {},
+        unparser_dialect: UnparserPostgreSqlDialect {},
+        expected: @"SELECT CAST(NULL AS VARCHAR[])",
+    );
+    Ok(())
+}
+
+#[test]
+fn test_cast_to_fixed_size_array_default_dialect() -> Result<(), 
DataFusionError> {
+    roundtrip_statement_with_dialect_helper!(
+        sql: "select cast(NULL as int[2])",
+        parser_dialect: GenericDialect {},
+        unparser_dialect: UnparserDefaultDialect {},
+        expected: @"SELECT CAST(NULL AS INTEGER[2])",
+    );
+    Ok(())
+}
+

Review Comment:
   Added `test_cast_to_nested_array` as suggested. It passes.
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to