Skip to content

Conversation

@luoyuxia
Copy link
Contributor

@luoyuxia luoyuxia commented Jan 15, 2026

Purpose

Linked issue: close #xxx
Fix when union read from lake table, and projectinn is enabled, the __timestamp in paimon will not match which cause cast exception

Brief change log

Use table origin row type instead of projected row type.

Tests

Adjust the test to use enable projection

API and Format

Documentation

} else {
Map<Integer, List<LakeSplit>> nonPartitionLakeSplits =
lakeSplits.values().iterator().next();
lakeSplits.isEmpty() ? null : lakeSplits.values().iterator().next();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when no split is generate, it may be empty. Let's use the safe way.

// we will have three additional system columns, __bucket, __offset, __timestamp
// in lake, get the __timestamp index in lake table
final int timestampFieldIndex = flussRowType.getFieldCount() + 2;
final int timestampFieldIndex = tableOutputType.getFieldCount() + 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flussRowType is projected row, we should use origin tableOutputType

}
});

if (pendingHybridLakeFlussSplits != null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move out from the loop to speed it.

@beryllw
Copy link
Contributor

beryllw commented Jan 16, 2026

LGTM!

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