Skip to content

[Bug] [Python] Bucketed append files written by PyPaimon lose append order once Java compacts the bucket #11029

Open

Description

@LuciferYang

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master (b000c39)

Compute Engine

Python

Minimal reproduce step

Create an append table with 'bucket' = '1' and a bucket-key. Commit six one-row batches with PyPaimon (seq = 0..5), then write one more row (seq = 6) with a Java writer at default settings and read the table.

What doesn't meet your expectations?

The rows come back as [2, 0, 1, 5, 4, 3, 6] instead of [0, 1, 2, 3, 4, 5, 6]. The docs say a bucketed append table keeps append order within a partition and bucket.

PyPaimon writes every file of a bucketed append table with min_sequence_number = max_sequence_number = the bucket's restored max, so all six files have the range (1, 1). Java's AppendOnlyWriter numbers rows from the restored max + 1. Six files reach compaction.min.file-num (5 by default), so the Java write compacts the bucket. BucketedAppendCompactManager picks files from a queue ordered by minSequenceNumber, and with equal numbers that queue does not return them in append order.

Anything else?

PyPaimon alone does not compact append tables, so the order is only lost once a Java writer compacts the bucket.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions