Skip to content

INSERT into an unpartitioned table fails when fanout is disabled #43

Closed as duplicate

Description

@andygrove

Describe the bug

When write.datafusion.fanout.enabled=false, insert_into always wraps the input in sort_by_partition (table/mod.rs#L216-L220). Unpartitioned tables never get a _partition column, so planning fails.

To Reproduce

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

Activity

  1. added
    bug
    on Oct 1, 2026
  2. andygrove commented on Oct 1, 2026

    @andygrove
    MemberAuthor

    Duplicate of #38

    The fix there removes this code path: once IcebergWriteExec declares its ordering requirement, insert_into no longer needs to call sort_by_partition. #38 now tracks the unpartitioned case and its repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions