[ https://issues.apache.org/jira/browse/SPARK-51740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-51740: ----------------------------------- Labels: pull-request-available (was: ) > get_json_object path parsing ignores leading spaces > --------------------------------------------------- > > Key: SPARK-51740 > URL: https://issues.apache.org/jira/browse/SPARK-51740 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 3.5.0 > Reporter: Harsh Motwani > Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > > The `get_json_object` expression does not consider leading spaces in the JSON > path. In this example, the second key is referenced even though the path > refers to the first key: > {code:java} > scala> spark.sql("""select get_json_object('{" a b c ": " leading space > present", "a b c ": "leading space absent"}', "$[' a b c ']")""").show() > +------------------------------------------------------------------------------------------------------+ > |get_json_object({" a b c ": " leading space present", "a b c ": "leading > space absent"}, $[' a b c '])| > +------------------------------------------------------------------------------------------------------+ > | > leading space absent| > +------------------------------------------------------------------------------------------------------+ > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org