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

JSON: Ensure all fields types work as expected when they are the first field in a frame #1080

Merged
merged 7 commits into from
Sep 11, 2024

Conversation

ryantxu
Copy link
Member

@ryantxu ryantxu commented Sep 10, 2024

Currently the first field in values is read into a generic array and then converted to vector. This fails for JSON fields.

This PR fixes parsing JSON from the first field.

@ryantxu ryantxu added the bug Something isn't working label Sep 10, 2024
@ryantxu ryantxu requested a review from a team as a code owner September 10, 2024 19:36
@ryantxu ryantxu requested a review from gabor September 10, 2024 19:36
Comment on lines 455 to 475
case FieldTypeInt64:
vals := newInt64Vector(0)
for iter.ReadArray() {
v := iter.ReadInt64()
vals.Append(v)
}
return vals, nil

case FieldTypeNullableInt64:
vals := newNullableInt64Vector(0)
for iter.ReadArray() {
t := iter.WhatIsNext()
if t == sdkjsoniter.NilValue {
iter.ReadNil()
vals.Append(nil)
} else {
v := iter.ReadInt64()
vals.Append(v)
}
}
return vals, nil
Copy link
Member Author

Choose a reason for hiding this comment

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

weirdly -- these are not necessary on my machine, but fail in CI without them 🤷🏻

@ryantxu ryantxu changed the title FieldTypeJSON: support JSON parsing when this is the first field JSON: Ensure all fields types work as expected when they are the first field in a frame Sep 10, 2024
Copy link
Contributor

@gabor gabor left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ryantxu ryantxu merged commit 84021fd into main Sep 11, 2024
3 checks passed
@ryantxu ryantxu deleted the json-parsing-first-field branch September 11, 2024 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants