Fokko commented on code in PR #1669: URL: https://github.com/apache/iceberg-python/pull/1669#discussion_r1959939976
########## pyiceberg/io/pyarrow.py: ########## @@ -1573,11 +1561,16 @@ def _table_from_scan_task(task: FileScanTask) -> pa.Table: tables = [f.result() for f in completed_futures if f.result()] + arrow_schema = schema_to_pyarrow(self._projected_schema, include_field_ids=False) + if len(tables) < 1: - return pa.Table.from_batches([], schema=schema_to_pyarrow(self._projected_schema, include_field_ids=False)) + return pa.Table.from_batches([], schema=arrow_schema) result = pa.concat_tables(tables, promote_options="permissive") + if property_as_bool(self._io.properties, PYARROW_USE_LARGE_TYPES_ON_READ, False): + result = result.cast(arrow_schema) Review Comment: I left this in, but I would be leaning toward deprecating this, since I don't think we want to trouble the user. I think it should be an implementation detail based on how large the total buffers are. ########## pyiceberg/io/pyarrow.py: ########## @@ -1573,11 +1561,16 @@ def _table_from_scan_task(task: FileScanTask) -> pa.Table: tables = [f.result() for f in completed_futures if f.result()] + arrow_schema = schema_to_pyarrow(self._projected_schema, include_field_ids=False) + if len(tables) < 1: - return pa.Table.from_batches([], schema=schema_to_pyarrow(self._projected_schema, include_field_ids=False)) + return pa.Table.from_batches([], schema=arrow_schema) result = pa.concat_tables(tables, promote_options="permissive") + if property_as_bool(self._io.properties, PYARROW_USE_LARGE_TYPES_ON_READ, False): + result = result.cast(arrow_schema) Review Comment: I left this in, but I would be leaning toward deprecating this, since I don't think we want to trouble the user. I think it should be an implementation detail based on how large the buffers are. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org