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

[flink] Avoid deprecated usage on TableSchema, DataType and DescriptorProperties #4611

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

yunfengzhou-hub
Copy link
Contributor

Purpose

Linked issue: #4442

This PR removes deprecated usages about Flink Table API, mainly including TableSchema and DescriptorProperties.

Tests

Existing test cases are used to verify this change.

API and Format

This change does not affect API or storage format.

Documentation

This change does not affect introduce a new feature.

Copy link
Contributor

@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.

I am concern about the serialization for watermark spec, can you create some test for compatibility? (You can create schema file from old Paimon, and read it in tests)

@yunfengzhou-hub
Copy link
Contributor Author

I am concern about the serialization for watermark spec, can you create some test for compatibility? (You can create schema file from old Paimon, and read it in tests)

@JingsongLi FlinkCatalogPropertiesUtilTest has recorded the serialization result as follows

Map<String, String> expected = new HashMap<>();
String watermarkPrefix = compoundKey(SCHEMA, WATERMARK, 0);
expected.put(compoundKey(watermarkPrefix, WATERMARK_ROWTIME), "test_time");
expected.put(
        compoundKey(watermarkPrefix, WATERMARK_STRATEGY_EXPR),
        "`test_time` - INTERVAL '0.001' SECOND");
expected.put(compoundKey(watermarkPrefix, WATERMARK_STRATEGY_DATA_TYPE), "TIMESTAMP(3)");

This code stands for the serialization result since the older versions of Paimon. This PR does not change this part of code, which means the compatibility should be guaranteed.

return builder.build();
}

@Override
public CatalogBaseTable copy() {
return new DataCatalogTable(
table,
getSchema().copy(),
Schema.newBuilder().fromSchema(schema).build(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why need to copy it? I see there is no copy in DefaultCatalogTable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The copy was added because the copy had been made in the existing implementation. But I agree with it that the copy is unnecessary. I'll remove it.

@JingsongLi
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit 6fb887f into apache:master Dec 2, 2024
10 of 12 checks passed
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