Skip to content

Flink: Support table-name as fallback key for catalog-table in connector options#15673

Open
lilei1128 wants to merge 2 commits intoapache:mainfrom
lilei1128:fix-15668
Open

Flink: Support table-name as fallback key for catalog-table in connector options#15673
lilei1128 wants to merge 2 commits intoapache:mainfrom
lilei1128:fix-15668

Conversation

@lilei1128
Copy link
Copy Markdown
Contributor

@lilei1128 lilei1128 commented Mar 18, 2026

When using the Flink Iceberg connector with 'connector'='iceberg', the
'table-name' option in the WITH clause was silently ignored. The connector
only recognized 'catalog-table' to specify the Iceberg table name, causing
it to fall back to the Flink DDL table name, auto-create a new empty table,
and return 0 rows on reads with no error.

This commit adds 'table-name' as a fallback key for the existing CATALOG_TABLE
ConfigOption via withFallbackKeys("table-name"), letting the Flink framework
handle the lookup natively with the following precedence:
catalog-table > table-name > Flink DDL table name

A WARN log is emitted when both options are set with conflicting values.
Changes are applied to all supported Flink versions (1.20, 2.0, 2.1).

@github-actions github-actions Bot added the flink label Mar 18, 2026
Copy link
Copy Markdown
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.

Thanks @lilei1128! I wonder, why would we add another way of doing the same thing? Is this option widely used?

Comment on lines +64 to +70
public static final ConfigOption<String> TABLE_NAME =
ConfigOptions.key("table-name")
.stringType()
.noDefaultValue()
.withDescription(
"Alias for 'catalog-table'. Table name managed in the underlying iceberg catalog"
+ " and database.");
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.

Instead of adding a new ConfigOption, we can add "table-name" via withFallbackKey("table-name") to the existing catalog-name option.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! Updated to use withFallbackKeys("table-name") on the existing
CATALOG_TABLE option instead of adding a separate ConfigOption.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The modification is complete. Could you please check it for me

@lilei1128 lilei1128 changed the title Flink: Support table-name as alias for catalog-table in connector opt… Flink: Support table-name as fallback key for catalog-table in connector options Apr 2, 2026
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.

2 participants