You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Anupam Yadav (Jira)" <ji...@apache.org> on 2026/04/11 04:26:00 UTC

[jira] [Commented] (SPARK-52709) Fix parsing of STRUCT<>

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

Anupam Yadav commented on SPARK-52709:
--------------------------------------

Thanks for reviewing the change [~cloud_fan] !

> 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
>            Priority: Major
>              Labels: pull-request-available, starter
>             Fix For: 4.2.0
>
>
> 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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org