You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Venk (Jira)" <ji...@apache.org> on 2022/01/11 08:06:00 UTC

[jira] [Updated] (SPARK-37857) Any depth search not working in get_json_object ($..foo)

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

Venk updated SPARK-37857:
-------------------------
    Description: 
The following example should return a value _abc_ but instead returns null

I checked the [spark test suite|[spark/JsonExpressionsSuite.scala at f12793de205a46c75529ac20649e2e61edc0b144 · apache/spark · GitHub|https://github.com/apache/spark/blob/f12793de205a46c75529ac20649e2e61edc0b144/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/JsonExpressionsSuite.scala]] and the example there seems to be for a negative test case, so I'm not sure if this is expected.
{code:java}
spark.sql("""select get_json_object('{"k":{"value":"abc"}}', '$..value') as j""").show()
{code}

  was:
The following example should return a value _abc_ but instead returns null
{code:java}
spark.sql("""select get_json_object('{"k":{"value":"abc"}}', '$..value') as j""").show()
{code}


> Any depth search not working in get_json_object ($..foo)
> --------------------------------------------------------
>
>                 Key: SPARK-37857
>                 URL: https://issues.apache.org/jira/browse/SPARK-37857
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.2.0
>            Reporter: Venk
>            Priority: Major
>
> The following example should return a value _abc_ but instead returns null
> I checked the [spark test suite|[spark/JsonExpressionsSuite.scala at f12793de205a46c75529ac20649e2e61edc0b144 · apache/spark · GitHub|https://github.com/apache/spark/blob/f12793de205a46c75529ac20649e2e61edc0b144/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/JsonExpressionsSuite.scala]] and the example there seems to be for a negative test case, so I'm not sure if this is expected.
> {code:java}
> spark.sql("""select get_json_object('{"k":{"value":"abc"}}', '$..value') as j""").show()
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org