You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/03/07 12:45:00 UTC

[jira] [Updated] (SPARK-46761) quoted strings in a JSON path should support ? characters

     [ https://issues.apache.org/jira/browse/SPARK-46761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated SPARK-46761:
-----------------------------------
    Labels: pull-request-available  (was: )

> quoted strings in a JSON path should support ? characters
> ---------------------------------------------------------
>
>                 Key: SPARK-46761
>                 URL: https://issues.apache.org/jira/browse/SPARK-46761
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0, 4.0.0
>            Reporter: Robert Joseph Evans
>            Priority: Major
>              Labels: pull-request-available
>
> I think this impacts all versions of Spark after SPARK-18677, which made the operator work at all in 2.1.0/2.0.3
> I comes down to
> {code:java}
>  name <- '.' ~> "[^\\.\\[]+".r | "['" ~> "[^\\'\\?]+".r <~ "']"{code}
> [https://github.com/apache/spark/blob/01bb1b1a3dbfc68f41d9b13de863d26d587c7e2f/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala#L79]
>  
> The regular expression/pattern is saying that we want a [' followed by one or more characters that are not a single quote ' or a question mark ? followed by ']. That question mark looks out of place. When I try to put in a question mark in a quoted string it fails to produce any result, but when I put the same data/path into [https://jsonpath.com/] I get a result
>  
> data
> {code:java}
> {"?":"QUESTION"} {code}
> path
> {code:java}
> $['?'] {code}
>  
> I also see no tests validating that a question mark is not allowed so I suspect that it is a long standing bug.



--
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