Fokko commented on PR #3447:
URL: https://github.com/apache/iceberg-python/pull/3447#issuecomment-7169839799

   Thanks for working on this! Two things I'd like to see addressed before 
merging:
   
   1. **New abstract method on `BaseScan`.** Adding `@abstractmethod 
to_arrow_batch_reader` to `BaseScan` breaks third party subclasses of 
`BaseScan`/`TableScan` that don't implement it: they now raise a `TypeError` on 
instantiation. Could we define `__arrow_c_stream__` on `DataScan` and 
`IncrementalAppendScan` instead, and leave `BaseScan` unchanged?
   
   2. **PyCapsule input on partitioned tables.** `_coerce_arrow_input` turns 
every non PyArrow producer into a `RecordBatchReader`, which 
`_dataframe_to_data_files` rejects for partitioned tables. Most producers 
people will pass (Polars DataFrames, arro3 Tables) are already in memory, so 
`tbl.append(polars_df)` fails on a partitioned table while 
`tbl.append(pa.table(polars_df))` works. I'd suggest materializing with 
`pa.table(df)` when the table is partitioned, and streaming only for 
unpartitioned tables.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to