Skip to content

Fixing issue with row update not working for PK table:#2876

Open
vamossagar12 wants to merge 4 commits intoapache:mainfrom
vamossagar12:fluss-2397
Open

Fixing issue with row update not working for PK table:#2876
vamossagar12 wants to merge 4 commits intoapache:mainfrom
vamossagar12:fluss-2397

Conversation

@vamossagar12
Copy link
Contributor

Purpose

Linked issue: close #2397

Brief change log

[FLUSS-2397] Fix UPDATE failure for primary key tables with computed columns

This commit fixes a bug where UPDATE statements failed when target tables
contained computed columns (e.g., PROCTIME). The root cause was that the
SinkWriter was using the table's physical RowType to initialize the
serialization schema, rather than the "consumed" RowType which includes
computed/metadata columns.

Key changes:

  • Introduced 'consumedRowType' in FlinkSinkWriter, AppendSinkWriter, and
    UpsertSinkWriter to properly handle schema projection during serialization.
  • Updated FlinkTableSink to ensure the correct row type is passed down to
    the writer.
  • Added a regression test in FlinkTableSinkITCase that reproduces the
    reported failure (Bug Row UPDATE not working (PK Table) #2397).
  • Updated internal builders and tests to accommodate the schema context.

Tests

fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/sink/FlinkTableSinkITCase.java

API and Format

N/A

Documentation

N/A

@vamossagar12
Copy link
Contributor Author

@polyzos , sorry for the delay- I got busy with other stuff. I created this PR. Please take a look!

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.

Row UPDATE not working (PK Table)

1 participant