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

Writing Parquet with a boolean column fails #657

Closed
bjchambers opened this issue Aug 5, 2021 · 0 comments · Fixed by #658
Closed

Writing Parquet with a boolean column fails #657

bjchambers opened this issue Aug 5, 2021 · 0 comments · Fixed by #658
Labels

Comments

@bjchambers
Copy link
Contributor

Describe the bug

When writing a parquet file with a boolean column I receive the error: EOF: unable to put boolean value.

To Reproduce

I don't yet have a minimal repro. For me I was writing batches of ~100k rows containing a uint64 column and a boolean column. The boolean column included null values.

Expected behavior

The boolean column to be correctly written.

Additional context

Based on debugging, I believe the problem may be the method used to extend the array:

            if bit_writer.bytes_written() + values.len() / 8 >= bit_writer.capacity() {
                bit_writer.extend(256);
            }

When my case fails, values.len() is 27054. I suspect that even after adding 256 bytes there isn't enough room for all of the values (256 bytes is 2048 bits). It would actually need to be extended with 3382 bytes to have enough capacity for all of those rows.

It should probably be extended with something like min(256, values.len() / 8) or values.len() / 8 rounded up to a power of 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant