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

Reference Tests and Breaking Change: Optional nullable fields are now null instead of undefined #114

Merged
merged 4 commits into from
Jan 19, 2024

Conversation

wilwade
Copy link
Member

@wilwade wilwade commented Jan 18, 2024

Problem

We wanted to add tests for all the tests in https://github.com/apache/parquet-testing

Discovered Bugs

  • We treated nulls as undefined, but others don't
  • We incorrectly processed dictionary_page_offset >= 0 instead of only > 0

Solution

  • Added new test that automatically tests all files: test/reference-test/read-all.test.ts
  • Fixed found bugs

with @shannonwells

Steps to Verify:

  1. Run the tests
  2. Comment out the bug fixes and see reference test files fail

Comment on lines +27 to +28
'float16_nonzeros_and_nans.parquet', // missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)
'float16_zeros_and_nans.parquet', // missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)
Copy link
Member Author

Choose a reason for hiding this comment

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

These can be removed once #108 is rebased on it and will work as a test to prove it is working.

Comment on lines +230 to +231
// This ensures that nulls are correctly processed
record[node.name] = value;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the change that makes null values shred to null instead of undefined.

Comment on lines +675 to +677
// If this exists and is greater than zero then we need to have an offset
if (metadata.dictionary_page_offset && +metadata.dictionary_page_offset > 0) {
const offset: number = +metadata.dictionary_page_offset;
Copy link
Member Author

Choose a reason for hiding this comment

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

Based in part around the information in https://issues.apache.org/jira/browse/PARQUET-1402

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixes for using null instead of undefined

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixes for using null instead of undefined

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixes for using null instead of undefined

Copy link
Collaborator

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

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

Works on my machine

@wilwade wilwade merged commit 8d34ac1 into main Jan 19, 2024
1 check passed
@wilwade wilwade deleted the testing/add-all-parquet-tools-files branch January 19, 2024 00:07
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