[ 
https://issues.apache.org/jira/browse/BEAM-9300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044781#comment-17044781
 ] 

Kyle Weaver commented on BEAM-9300:
-----------------------------------

We can convert ZetaSQL Struct to Calcite ROW, but there are the following known 
issues with BeamZetaSqlCalcRel:

 1. When unparsing the dereference of a struct (e.g. `STRUCT(1 as a).a`), the 
Calcite 1.20 version of SqlImplementor throws an exception because it cannot 
properly dereference a ROW. This seems to be fixed in Calcite 1.21: 
https://github.com/apache/calcite/blob/branch-1.21/core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java#L508-L511

2. Prepare expression fails because ROW is not valid in ZetaSQL. ZetaSQL 
expects Struct instead. So we might have to unparse ROW back into Struct.

> parse struct literal in ZetaSQL
> -------------------------------
>
>                 Key: BEAM-9300
>                 URL: https://issues.apache.org/jira/browse/BEAM-9300
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql-zetasql
>            Reporter: Kyle Weaver
>            Assignee: Kyle Weaver
>            Priority: Major
>
> https://github.com/apache/beam/blob/b02a325409d55f1ecb7f9fb6ecc4f60a974c810d/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/ExpressionConverter.java#L569



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to