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

Fix OpenX JSON decoding of top level JSON array #23163

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

dain
Copy link
Member

@dain dain commented Aug 29, 2024

Description

OpenX JSON supports decoding JSON lines containing a JSON array, as opposed to a JSON object. In this case the values are mapped to columns using the ordinal position instead of mapping by field name. The decoder was not using the Column ordinal and instead was just using the position in the output list, which resulted in data appearing in the wrong output column.

This bug has been present since the first version of the native OpenX JSON decoder.

Fixes #23120

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(X) Release notes are required, with the following suggested text:

# Hive
* Fix OpenX JSON decoding a JSON array line that resulted in data being written to wrong output column. ({issue}`23120`)

OpenX JSON supports decoding JSON lines containing a JSON array, as
opposed to a JSON object. In this case the values are mapped to columns
using the ordinal position instead of mapping by field name. The decoder
was not using the Column ordinal and instead was just using the position
in the output list, which resulted in data appearing in the wrong output
column.
@dain dain added bug Something isn't working correctness labels Aug 29, 2024
@dain dain requested a review from electrum August 29, 2024 00:13
@cla-bot cla-bot bot added the cla-signed label Aug 29, 2024
@dain dain merged commit 2604f97 into trinodb:master Sep 6, 2024
55 of 56 checks passed
@dain dain deleted the openx-json-fix branch September 6, 2024 16:01
@github-actions github-actions bot added this to the 456 milestone Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla-signed correctness
Development

Successfully merging this pull request may close these issues.

OpenXJson Reordering Columns in Projection doesn't work with Top-level Arrays
3 participants