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


##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -1846,6 +1811,32 @@ impl Unparser<'_> {
         }))
     }
 
+    fn array_to_ast_dtype(
+        &self,
+        data_type: &DataType,
+        inner: &FieldRef,
+        size: Option<i32>,
+    ) -> Result<ast::DataType> {
+        let elem = Box::new(self.arrow_dtype_to_ast_dtype(inner)?);
+        let elem_def = match (self.dialect.array_type_style(), size) {
+            (ArrayTypeStyle::SquareBracket, size) => {
+                ast::ArrayElemTypeDef::SquareBracket(elem, size.map(|s| s as 
u64))
+            }
+            // BigQuery, the only dialect with this style, rejects an array of 
arrays.
+            (ArrayTypeStyle::AngleBracket, None)
+                if !matches!(*elem, ast::DataType::Array(_)) =>
+            {
+                ast::ArrayElemTypeDef::AngleBracket(elem)
+            }

Review Comment:
   I reviewed what the agent did. It's what you suggested and I agree it's the 
right path.



##########
datafusion/sql/src/unparser/expr.rs:
##########


Review Comment:
   That said this looks right. Sorry for any noise.



-- 
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