Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Spark get_json_object function support incomplete json #12417

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leoluan2009
Copy link
Contributor

@leoluan2009 leoluan2009 commented Feb 21, 2025

Spark get_json_object support incomplete json, for example : select get_json_object('{"hello": "3.5"},', '$.'hello) will return 3.5, but velox will return null

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 21, 2025
Copy link

netlify bot commented Feb 21, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit b12d1d4
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67b805e9732f0b0008b0fa07

@leoluan2009
Copy link
Contributor Author

@PHILO-HE , can you help to review? cc: @rui-mo

Copy link
Contributor

@PHILO-HE PHILO-HE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pasted simdjson's pr link for this incomplete json support: simdjson/simdjson#2189. It's an experimental functionality.

Not sure whether there will be any side effect for Spark workload. It would be better to add more incomplete json cases in test and verify the result with vanilla Spark.

@@ -47,4 +47,9 @@ void simdjsonErrorsToExceptions(
simdjson::simdjson_result<simdjson::ondemand::document> simdjsonParse(
const simdjson::padded_string_view& json);

/// Parse the input incomplete json string using a thread local on demand
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/// Parse the input json string using a thread local on demand parser. Allow incomplete json input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants