Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spark] Allows data with missing columns to be written when enable 'merge-schema' #5059

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

YannByron
Copy link
Contributor

Purpose

Linked issue: close #xxx

Tests

API and Format

Documentation

@YannByron YannByron requested a review from Zouxxyy February 11, 2025 09:46

// For case that some columns is absent in data, we still allow to write once write.merge-schema is true.
val newTableSchema = SparkTypeUtils.fromPaimonRowType(table.schema().logicalRowType())
if (!schemaEqualsIgnoreNullability(newTableSchema, data.schema)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

dataSchema is better


// For case that some columns is absent in data, we still allow to write once write.merge-schema is true.
val newTableSchema = SparkTypeUtils.fromPaimonRowType(table.schema().logicalRowType())
if (!schemaEqualsIgnoreNullability(newTableSchema, data.schema)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe can refer to spark DataType.sameType or DataType.equalsIgnoreNullability

Copy link
Contributor

@Zouxxyy Zouxxyy left a comment

Choose a reason for hiding this comment

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

+1

@Zouxxyy Zouxxyy merged commit 7f01330 into apache:master Feb 12, 2025
12 checks passed
JackeyLee007 pushed a commit to JackeyLee007/paimon that referenced this pull request Feb 14, 2025
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