Skip to content

[python] Add row kind support for TableRead#7394

Merged
JingsongLi merged 1 commit intoapache:masterfrom
tub:python-streaming-1b2-row-kind
Mar 11, 2026
Merged

[python] Add row kind support for TableRead#7394
JingsongLi merged 1 commit intoapache:masterfrom
tub:python-streaming-1b2-row-kind

Conversation

@tub
Copy link
Contributor

@tub tub commented Mar 10, 2026

Summary

Exposes row_kind from TableRead so that users can perform different actions depending on the type of change happening.

  • Add include_row_kind parameter to TableRead for streaming change tracking
  • Prepend a _row_kind string column (+I, -D, +U, -U) to Arrow batches when enabled
  • Support row kind for both RecordBatchReader (default +I) and OffsetRow-based readers (from RowKind)

Stacked PR series

This is PR 1b part 2 in the Python streaming read series:

Incremental diff (vs 1b): tub/paimon@python-streaming-1b-scanners...tub:paimon:python-streaming-1b2-row-kind

Test plan

  • flake8 passes
  • python -m pytest passes
  • Manually verify row kind column appears in streaming reads

LLM generated, human reviewed

Generated using Claude, tested manually and iterated upon by a human :)

Add include_row_kind option to TableRead that prepends a _row_kind
string column to Arrow output. For RecordBatchReader (append-only
tables) all rows default to "+I"; for RowIterator (primary-key
tables) row kind is read per-row via OffsetRow.get_row_kind().

The feature is opt-in (include_row_kind=False by default) so
existing read paths are unaffected. StreamReadBuilder in the next
PR will enable it for changelog/streaming reads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tub tub force-pushed the python-streaming-1b2-row-kind branch from e87c3bf to a1681ac Compare March 11, 2026 11:56
@tub tub marked this pull request as ready for review March 11, 2026 12:00
@JingsongLi
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit 75e0e4e into apache:master Mar 11, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants