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

Allow RLE for bools in v1 pages #885

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions fastparquet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ def read_data_page(f, helper, header, metadata, skip_nulls=False,
nval = daph.num_values - num_nulls
se = helper.schema_element(metadata.path_in_schema)
if daph.encoding == parquet_thrift.Encoding.PLAIN:

width = helper.schema_element(metadata.path_in_schema).type_length
width = se.type_length
values = read_plain(io_obj.read(),
metadata.type,
int(daph.num_values - num_nulls),
Expand All @@ -137,7 +136,9 @@ def read_data_page(f, helper, header, metadata, skip_nulls=False,
parquet_thrift.Encoding.RLE_DICTIONARY,
parquet_thrift.Encoding.RLE]:
# bit_width is stored as single byte.
if daph.encoding == parquet_thrift.Encoding.RLE:
if metadata.type == parquet_thrift.Type.BOOLEAN:
bit_width = 1
elif daph.encoding == parquet_thrift.Encoding.RLE:
bit_width = se.type_length
else:
bit_width = io_obj.read_byte()
Expand Down
Loading