You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/21 18:50:10 UTC

[GitHub] [arrow-datafusion] lquerel commented on issue #2043: How to build a field of type Struct with DataFusion SQL?

lquerel commented on issue #2043:
URL: https://github.com/apache/arrow-datafusion/issues/2043#issuecomment-1074285552


   Different approaches to represent a structure in the projection part of a SELECT.
   
   **BigQuery syntax:** 
   `STRUCT('Bob' AS name, 38 AS age) AS users`
   `STRUCT<name string, age integer>('Bob', 50) as user          // syntax to specify explicitly the type of each field`
   
   **Spark syntax:**
   `NAMED_STRUCT('name', 'Bob', 'age', 50) as users`
   
   **Postgres and Athena syntax:** 
   `CAST(ROW('Bob', 38) AS ROW(name VARCHAR, age INTEGER)) AS users`
   
   **Snowflake syntax:**
   `OBJECT_CONSTRUCT('name', 'Bob'::VARCHAR, 'age',  50::INTEGER)`
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org