adriangb commented on code in PR #27524:
URL: https://github.com/apache/datafusion/pull/27524#discussion_r4600910817
##########
datafusion/sql/src/unparser/expr.rs:
##########
@@ -1811,6 +1811,30 @@ 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))
+ }
+ (ArrayTypeStyle::AngleBracket, None) => {
+ ast::ArrayElemTypeDef::AngleBracket(elem)
Review Comment:
Good catch, thanks. The `AngleBracket` style now returns the
unsupported-type error when the element is itself a list, and the BigQuery
nested test expects that error. The `SquareBracket` style keeps nested lists.
Struct elements are not affected, because BigQuery allows `ARRAY<STRUCT<...>>`.
--
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]