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

Support skip_values in DictionaryDecoder #2097

Closed
wants to merge 1 commit into from

Conversation

Ted-Jiang
Copy link
Member

Which issue does this PR close?

Closes #2709.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the parquet Changes to the parquet crate label Jul 18, 2022
assert!(matches!(output, DictionaryBuffer::Dict { .. }));

assert_eq!(decoder.skip_values(1).unwrap(), 1);
assert_eq!(decoder.read(&mut output, 0..3).unwrap(), 3);
Copy link
Member Author

Choose a reason for hiding this comment

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

@tustvold Like you metion in #2076 (comment)
If i try to use assert_eq!(decoder.read(&mut output, 3..6).unwrap(), 3);

The result is not right, also appear in test_dictionary_preservation
i think we should align it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be 2..5 if anything, you've only read 2 values

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

I started reviewing this before I realised I'd just merged #2097... How would you like to proceed, I think there might perhaps be value in some of the tests??

assert!(matches!(output, DictionaryBuffer::Dict { .. }));

assert_eq!(decoder.skip_values(1).unwrap(), 1);
assert_eq!(decoder.read(&mut output, 0..3).unwrap(), 3);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be 2..5 if anything, you've only read 2 values

.as_ref()
.ok_or_else(|| general_err!("missing dictionary page for column"))?;

if dict.is_empty() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why this check is necessary, removing the corresponding check from read, doesn't seem to fail any tests

assert_eq!(decoder.skip_values(1).unwrap(), 1);
assert_eq!(decoder.read(&mut output, 0..3).unwrap(), 3);

valid.extend_from_slice(&[false, false, false, true, false, true, true, false]);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these tests would be easier to follow if they didn't include the null padding logic, which seems unnecessary for testing the skip behaviour

@Ted-Jiang
Copy link
Member Author

duplicate with #2100

@Ted-Jiang Ted-Jiang closed this Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants