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 NULL handling in Arrow result handler #195

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

kravets-levko
Copy link
Contributor

Fixes #188

Preserve NULL values when processing Arrow result

Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Comment on lines +144 to +145
const value = record[field];
result[field] = value === null ? null : convertThriftValue(typeDescriptor, value);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is basically the same logic as in JsonResult:

return columnValue.values.map((value: any, i: number) => {
if (columnValue.nulls && this.isNull(columnValue.nulls, i)) {
return null;
}
return convertThriftValue(typeDescriptor, value);
});

Copy link

@susodapop susodapop left a comment

Choose a reason for hiding this comment

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

LGTM

@kravets-levko kravets-levko merged commit 959d320 into main Oct 5, 2023
@kravets-levko kravets-levko deleted the arrow-result-null-handling branch October 5, 2023 15:49
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.

nulls are returned as 0s
2 participants