Skip to content

Flink: Migrate Flink TableSchema for IcebergSource #13072

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

liamzwbao
Copy link

@liamzwbao liamzwbao commented May 15, 2025

Summary

This is part of #13054.

To deprecate FlinkSchemaUtil.convert(TableSchema), we also need to deprecate its dependent methods and remove the use of TableSchema. This PR contributes to that goal by removing TableSchema usage from IcebergSource.

@github-actions github-actions bot added the flink label May 15, 2025
@liamzwbao liamzwbao force-pushed the issue-13054-tableschema-deprecations-iceberg-source branch from c73881f to e0f7eea Compare May 18, 2025 00:15
@liamzwbao liamzwbao marked this pull request as ready for review May 18, 2025 00:23
@liamzwbao
Copy link
Author

Hi @ajantha-bhat @nastra. PTAL, thank you!

@liamzwbao liamzwbao changed the title Migrate Flink TableSchema for IcebergSource Flink: Migrate Flink TableSchema for IcebergSource May 18, 2025
@nastra nastra requested a review from pvary May 19, 2025 06:18
columns.add(
Column.physical(field.getName(), TypeConversions.fromLogicalToDataType(field.getType())));
}
return ResolvedSchema.of(columns);
Copy link
Contributor

Choose a reason for hiding this comment

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

@pvary
Copy link
Contributor

pvary commented May 19, 2025

I remember previous attempts to remove TableSchema from Flink are failed. Could you please check if we were able to backport these changes to Flink 1.19/1.20?

Thanks for working on this!

Copy link
Contributor

@mxm mxm left a comment

Choose a reason for hiding this comment

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

Generally, looks good. I've left some comments regarding the deprecated methods.

*/
@Deprecated
public static Schema convert(Schema baseSchema, TableSchema flinkSchema) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we get rid of this method, at least for 2.0?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to keep the Flink 2.0 and 1.19/1.18 code as similar as possible, so we will not have problems with the backports between the different branches. So if this PR is working for 1.19/1.18, then I'm fine with deprecating, and later removing methods, but if not, then I would keep them until the all the Flink versions not supporting them is deprecated.

WDYT?

*/
@Deprecated
public static TableSchema toSchema(RowType rowType) {
Copy link
Contributor

@mxm mxm May 20, 2025

Choose a reason for hiding this comment

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

Should we get rid of this method? AFAIK it's only used in tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Every public method should be handled as an API, unless it is marked with @Internal annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants