andygrove opened a new issue, #43:
URL: https://github.com/apache/datafusion-iceberg/issues/43

   ### Describe the bug
   
   When `write.datafusion.fanout.enabled=false`, `insert_into` always wraps the 
input in `sort_by_partition` 
([table/mod.rs#L216-L220](https://github.com/apache/datafusion-iceberg/blob/a2bc9427d0659591b5f8122b90fec710fe2f5de6/crates/datafusion/src/table/mod.rs#L216-L220)).
 Unpartitioned tables never get a `_partition` column, so planning fails.
   
   ### To Reproduce
   
   ```sql
   -- t(id INT NOT NULL), unpartitioned, with table property 
write.datafusion.fanout.enabled=false
   INSERT INTO t VALUES (1);
   ```
   
   ```
   Error during planning: Partition column '_partition' not found in schema. 
Ensure the plan has been extended with partition values using 
project_with_partition.
   ```
   
   ### Expected behavior
   
   The property has no effect on unpartitioned tables, and the insert succeeds.
   
   ### Additional context
   
   Skip the sort when the partition spec is unpartitioned. Related to the 
partitioned case of the same setting: #38, #39.
   


-- 
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