Skip to content

[C++][Python] Support NaN/Infinity in JSON parsing and accept DictionaryEncoding without indexType in IPC reader - #53871

Draft
Asthenia0412 wants to merge 1 commit into
apache:mainfrom
Asthenia0412:feat/arrow-json-naninf-ipc-dict
Draft

Asthenia0412 wants to merge 1 commit into
apache:mainfrom
Asthenia0412:feat/arrow-json-naninf-ipc-dict

Conversation

@Asthenia0412

Copy link
Copy Markdown

Two Arrow C++ format-compatibility fixes: 1) bump simdjson to v5.0.5 with SIMDJSON_ENABLE_NAN_INF=ON so JSON accepts NaN/Infinity/Inf literals; 2) in IPC metadata_internal.cc, default null DictionaryEncoding.indexType to signed int32 per Schema.fbs. Includes a new C++ unit test DictionaryEncodingWithoutIndexType. All 432 IPC tests and 242 JSON tests pass.

…pt DictionaryEncoding without indexType in IPC reader

Two related Arrow format compatibility fixes:

1. Bump embedded simdjson from v4.6.4 to v5.0.5 and enable
   SIMDJSON_ENABLE_NAN_INF so JSON parsing accepts NaN, Infinity,
   -Infinity, Inf and -Inf (case-insensitive). The Arrow JSON reader
   already had NonFiniteDoubleFromRawToken as a partial workaround,
   but simdjson v5.0 gives first-class, case-insensitive support.

2. In the IPC reader, treat DictionaryEncoding.indexType being null
   as signed int32 indices per the Arrow format spec. Previously
   metadata_internal.cc used CHECK_FLATBUFFERS_NOT_NULL and rejected
   well-formed IPC streams written by e.g. apache-arrow (JavaScript)
   when the JS writer omitted indexType.

Tests:
- New C++ unit test IPC DictionaryEncodingWithoutIndexType round-trips
  through metadata_internal::GetSchema with a hand-built flatbuffer.
- All existing JSON from_string tests (including NaN/Inf coverage)
  continue to pass on simdjson v5.0.5.
@github-actions

Copy link
Copy Markdown

Thanks for opening a pull request!

This pull request has been automatically converted to a draft because its title doesn't match Arrow's required format.

If this is not a minor PR, could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

After updating the title, you can mark the pull request as ready for review.

See also:

@github-actions
github-actions Bot marked this pull request as draft October 15, 2026 05:29
@taepper

taepper commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Wouldn't we rather bump to version 5 first and then change the functionality afterwards?

}
}

// ARROW-XXXXX: DictionaryEncoding.indexType may be null per the Arrow format

@taepper taepper Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

// ARROW-XXXXX: DictionaryEncoding.indexType may be null per the Arrow format

I think you forgot to fill this one out

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants