lihaosky opened a new pull request, #28385: URL: https://github.com/apache/flink/pull/28385
## What is the purpose of the change Part of [FLIP-529: Connections in Flink SQL and TableAPI](https://cwiki.apache.org/confluence/display/FLINK/FLIP-529%3A+Connections+in+Flink+SQL+and+TableAPI) (parent: FLINK-38259). Threads the connection identifier from a parsed `USING CONNECTION` clause in `SqlCreateTable` (added in FLINK-39726) through to `CatalogTable` and the `CreateTableOperation`, mirroring how the optional `distribution` field is wired. ## Brief change log - Add `Optional<UnresolvedIdentifier> getConnection()` to `CatalogTable` with a `connection()` builder method, and the backing field/accessor in `DefaultCatalogTable` (equals/hashCode/toString/copy updated; existing constructors kept for compatibility). - Delegate `getConnection()` in `ResolvedCatalogTable`. - Read `SqlCreateTable.getConnection()` in `AbstractCreateTableConverter` and set it on the built `CatalogTable`, so `CreateTableOperation#getCatalogTable().getConnection()` carries the reference. - Serialize/deserialize the connection identifier in `CatalogPropertiesUtil` under a reserved `connection.identifier` key, excluded from connector options, so it round-trips through `toProperties`/`fromProperties` and appears in operation summaries. ## Verifying this change This change added tests and can be verified as follows: - Added `SqlDdlToOperationConverterTest#testCreateTableWithConnection` / `#testCreateTableWithoutConnection` with a new `OperationMatchers#withConnection` matcher. - Added a `ResolvedCatalogTable` serde case carrying a connection to `CatalogPropertiesUtilTest#testCatalogTableSerde`. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: yes (`CatalogTable`, `ResolvedCatalogTable` gain an optional getter with a default) - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable (docs will accompany the completed FLIP-529 feature) --- ##### Was generative AI tooling used to co-author this PR? Yes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
