Skip to content

[FLINK-39657][hive] Migrate CatalogTable.of() to CatalogTable.newBuilder()#41

Open
jlalwani-amazon wants to merge 1 commit into
apache:mainfrom
jlalwani-amazon:flink-39657-catalogtable-newbuilder
Open

[FLINK-39657][hive] Migrate CatalogTable.of() to CatalogTable.newBuilder()#41
jlalwani-amazon wants to merge 1 commit into
apache:mainfrom
jlalwani-amazon:flink-39657-catalogtable-newbuilder

Conversation

@jlalwani-amazon
Copy link
Copy Markdown

What is the purpose of the change

Replace all usages of the deprecated CatalogTable.of(schema, comment, partitionKeys, options) with the new builder API CatalogTable.newBuilder().schema(s).comment(c).partitionKeys(p).options(o).build().

CatalogTable.of() is deprecated and will be removed in Flink 2.0 GA.

JIRA: FLINK-39657

Brief change log

  • Migrate all 43 call sites across 15 files (main source + tests)
  • No behavioral changes — pure API migration

Verifying this change

CI passed on fork: https://github.com/jlalwani-amazon/flink-connector-hive/actions

mvn compile test-compile -pl flink-connector-hive -am

Does this pull request potentially affect one of the following parts?

  • Dependencies: no
  • The public API: no
  • The serializers: no
  • The runtime per-record code paths: no
  • Anything that affects deployment or recovery: no

…der()

Replace all 43 usages of the deprecated CatalogTable.of(schema, comment,
partitionKeys, options) with the new builder API:
CatalogTable.newBuilder().schema(s).comment(c).partitionKeys(p).options(o).build()

CatalogTable.of() will be removed in Flink 2.0 GA.
.build())
.comment("values temp table")
.partitionKeys(new ArrayList<>())
.options(Collections.emptyMap())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
.options(Collections.emptyMap())
.options(Map.of())

.schema(Schema.newBuilder().build())
.comment(null)
.partitionKeys(new ArrayList<>())
.options(Collections.emptyMap())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
.options(Collections.emptyMap())
.options(Map.of())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here and in other places

Comment on lines +97 to +98
.partitionKeys(Collections.emptyList())
.options(Collections.emptyMap())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
.partitionKeys(Collections.emptyList())
.options(Collections.emptyMap())
.partitionKeys(List.of))
.options(Map.of())

here and in other places

.fromResolvedSchema(resolvedSchema)
.build())
.comment(null)
.partitionKeys(new ArrayList<>())
Copy link
Copy Markdown
Contributor

@snuyanzin snuyanzin May 27, 2026

Choose a reason for hiding this comment

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

what is the reason to have new ArrayList() instead of List.of() ?

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