Skip to content

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