Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Handle null values while parsing double and float#57

Open
Szczurowsky wants to merge 1 commit into
simdjson:mainsimdjson/simdjson-java:mainfrom
Szczurowsky:handle-null-valuesSzczurowsky/simdjson-java:handle-null-valuesCopy head branch name to clipboard
Open

Handle null values while parsing double and float#57
Szczurowsky wants to merge 1 commit into
simdjson:mainsimdjson/simdjson-java:mainfrom
Szczurowsky:handle-null-valuesSzczurowsky/simdjson-java:handle-null-valuesCopy head branch name to clipboard

Conversation

@Szczurowsky
Copy link
Copy Markdown

When you try to parse JSON that has field with type (for ex.) double and value of that field is null, then it throws and exception.
That PR will allow such value for Double and Float, since they have value NaN that fits for that purpose.

@Szczurowsky Szczurowsky changed the title handle null values while parsing double and float Handle null values while parsing double and float Aug 30, 2024
@piotrrzysko
Copy link
Copy Markdown
Member

Thanks for the PR. A couple of comments:

  1. It would be good to add a test for this.
  2. I'm not sure why the parser should return NaN in this case. If a field is defined as float (not Float), and the JSON contains null for that field, it seems like an error that shouldn't be hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.