Mihailo Milosevic created SPARK-52709:
-----------------------------------------

             Summary: Fix parsing of STRUCT<>
                 Key: SPARK-52709
                 URL: https://issues.apache.org/jira/browse/SPARK-52709
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 4.1.0
            Reporter: Mihailo Milosevic


Currently spark has wrong logic of STRUCT parsing. We introduce up-count of 
parenthesis for when we see a word STRUCT, not when we see an open parentesis. 
This leads to the problem when we have STRUCT<>. In lexer NEQ is before LT, 
which means that we will match STRUCT and NEQ. In this case we would increase 
the counter, but would never decrease it for the next iterations. This leads to 
the following query failing with syntax error:
```

SELECT cast(null as STRUCT<>), 2 >> 1;

```

This ticket needs to address the issue of spark not knowing how many 
parenthesis are present when empty structs are in the loop.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to