Skip to content
Closed
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
9 changes: 8 additions & 1 deletion awswrangler/s3/_read_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,15 @@ def _read_parquet_chunked(
chunks = pq_file.iter_batches(
batch_size=batch_size, columns=columns, use_threads=use_threads_flag, use_pandas_metadata=False
)

if columns is not None:
field_dict = {field.name: field for field in pq_file.schema.to_arrow_schema()}
schema = pa.schema([field_dict[column] for column in columns])
else:
schema = pq_file.schema.to_arrow_schema()

table = _add_table_partitions(
table=pa.Table.from_batches(chunks, schema=pq_file.schema.to_arrow_schema()),
table=pa.Table.from_batches(chunks, schema=schema),
path=path,
path_root=path_root,
)
Expand Down