Skip to content

Fix that field nullability affects write #24

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

Merged
merged 4 commits into from
Nov 12, 2024
Merged

Conversation

yuzelin
Copy link
Contributor

@yuzelin yuzelin commented Nov 11, 2024

Purpose

The case is:

  1. create a primary key table, the column pk is non-null from Paimon;
  2. schema of arrow data might not be defined pk not null strictly , so with pa.RecordBatchStreamWriter(stream, self._arrow_schema) as writer will throw error.

Fix: pa.RecordBatchStreamWriter use data's schema, and let java codes to check field (ignore nullability)

Tests

API and Format

Documentation

}

public void write(byte[] bytes) throws Exception {
public void write(byte[] bytes, boolean needCheckSchema) throws Exception {

Choose a reason for hiding this comment

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

check schema always?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

record_batch in #write_pandas is converted from table schema, so it is unnecessary to check it.

return true;
}

private boolean checkField(Field expected, Field actual) {
Copy link

@JingsongLi JingsongLi Nov 11, 2024

Choose a reason for hiding this comment

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

checkFieldIgnoreNullability

Copy link

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 00af9ad into apache:main Nov 12, 2024
1 check passed
yuzelin added a commit that referenced this pull request Nov 19, 2024
@yuzelin yuzelin deleted the hotfix branch December 2, 2024 08:27
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