You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by Mayank Juneja <ma...@gmail.com> on 2025/04/29 15:07:35 UTC

[DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Hi all,

I would like to open up for discussion a new FLIP-529 [1].

Motivation:
Currently, Flink SQL handles external connectivity by defining endpoints
and credentials in table configuration. This approach prevents reusability
of these connections and makes table definition less secure by exposing
sensitive information.
We propose the introduction of a new "connection" resource in Flink. This
will be a pluggable resource configured with a remote endpoint and
associated access key. Once defined, connections can be reused across table
definitions, and eventually for model definition (as discussed in FLIP-437)
for inference, enabling seamless and secure integration with external
systems.
The connection resource will provide a new, optional way to manage external
connectivity in Flink. Existing methods for table definitions will remain
unchanged.

[1] https://cwiki.apache.org/confluence/x/cYroF

Best Regards,
Mayank Juneja

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Ryan van Huuksloot <ry...@shopify.com.INVALID>.
Hi Mayank,

Thanks for the response. I have a few more questions.

1. Why not use a catalog that has default properties? That way you could
re-use properties if the object exists in that catalog/database.

---

If we are insistent on Connections.

1. I don't understand the distinction between a "CONNECTION" and the rest
of the properties that may exist on a table. In your flip you have some
properties on the Connection object and some on the table object. How would
someone decide which object the property should exist under?

2. We're referencing a SQL object through a properties string.
In SQL, you usually interact with SQL objects with SQL syntax, not a string
property.

Why not support something like this? Connectors already enforce what
properties are required. This provides broader utility while solving for
your use case - from my understanding.

*Note: I much prefer catalogs for this case. Which is what we use
internally to manage connection properties.*

CREATE OR REPLACE CONNECTION mysql_customer_db
WITH (
  'connector' = 'jdbc',
  'jdbc.url' = 'jdbc:mysql://customer-db.example.com:3306/customerdb',
  'jdbc.auth.type' = 'basic',
  'jdbc.username' = 'readonly_user',
  'jdbc.password' = 'secret123',
  'jdbc.connection.ssl.enabled' = 'true'
);
CREATE TABLE customers (
  customer_id INT,
  name STRING,
  email STRING,
  country STRING,
  vip_status BOOLEAN,
  PRIMARY KEY (customer_id) NOT ENFORCED
) WITH CONNECTION mysql_customer_db OVERRIDE (
  'jdbc.table-name' = 'customers',
  'jdbc.lookup.cache' = 'PARTIAL',
  'jdbc.lookup.partial-cache.max-rows' = '10000',
  'jdbc.lookup.partial-cache.expire-after-write' = '1h',
  'jdbc.lookup.partial-cache.expire-after-access' = '10m'
);

From my perspective, this FLIP has a SQL smell. I would be interested to
hear what folks like Timo think.

Ryan van Huuksloot
Sr. Production Engineer | Streaming Platform
[image: Shopify]
<https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>


On Wed, May 28, 2025 at 10:23 AM Mayank Juneja <ma...@gmail.com>
wrote:

> Thanks all for the feedback on the FLIP. If there are no more discussions,
> I will start voting on this tomorrow.
>
> On Wed, May 21, 2025 at 6:00 AM Mayank Juneja <ma...@gmail.com>
> wrote:
>
> > Hi Ryan,
> >
> > Thanks for the feedback.
> >
> > Just a quick clarification—DESCRIBE TABLE in Flink does *not* show table
> > properties; I believe you might be thinking of SHOW CREATE TABLE, which
> > does include properties as part of the DDL output. The goal of SHOW
> > CREATE TABLE is to provide a fully reproducible statement, so if secrets
> > were hidden or omitted, that reproducibility would be lost. By
> referencing
> > a named CONNECTION, we avoid this issue—users can reconstruct the table
> > DDL without exposing secrets directly, since the sensitive information
> > lives in the reusable connection object.
> >
> > Regarding the naming: CONNECTION is not part of the SQL standard, but
> > neither are alternatives like SECRET or INTEGRATION. We opted for
> > CONNECTION because it conveys intent clearly and aligns with common
> > terminology in data platforms, even if it's not a standard keyword.
> >
> > That said, we're definitely open to refining the naming based on broader
> > community input. Appreciate you raising these points and helping move the
> > conversation forward.
> >
> > Best,
> > Mayank
> >
> > On Fri, May 16, 2025 at 7:15 PM Ryan van Huuksloot
> > <ry...@shopify.com.invalid> wrote:
> >
> >> Hi Mayank,
> >>
> >> Overall I think the idea of having shared properties (secrets or
> >> otherwise)
> >> at the database layer is really interesting/useful. Even outside of the
> ML
> >> scope.
> >>
> >> However, I have a concern:
> >> When I describe a table, I would not like it if all properties did not
> >> appear in the returned results of the describe. It adds a hidden layer
> of
> >> properties.
> >> CONNECTION is not a standard SQL syntax (at least that I am aware of,
> >> please correct me if I am wrong) and it adds a FlinkSQL specific layer
> of
> >> complexity.
> >>
> >> I like the idea of Grants to hide secrets rather than nesting them in a
> >> Connection object. The Connection object could still be described.
> >> Something akin to Snowflake's Secrets (
> >> https://docs.snowflake.com/en/sql-reference/sql/show-secrets) that can
> be
> >> referenced within table properties and could be obfuscated during a
> >> describe.
> >>
> >> Then if we hide secrets, we can figure out a different name than
> >> Connection
> >> for common properties and they can be shown as part of the table spec.
> >>
> >> Thoughts?
> >>
> >> Ryan van Huuksloot
> >> Sr. Production Engineer | Streaming Platform
> >> [image: Shopify]
> >> <
> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>
> >>
> >>
> >> On Fri, May 16, 2025 at 1:35 PM Yash Anand <yanand@confluent.io.invalid
> >
> >> wrote:
> >>
> >> > Hi Mayank,
> >> >
> >> > Thanks for the initiative! I think this functionality would be a
> really
> >> > great addition to Flink.
> >> >
> >> > +1 for the proposal.
> >> >
> >> > Thanks,
> >> > Yash
> >> >
> >> > On Tue, May 6, 2025 at 9:36 AM Mayank Juneja <
> mayankjuneja27@gmail.com>
> >> > wrote:
> >> >
> >> > > Hi Ferenc,
> >> > >
> >> > > Thanks for your question! We agree that a CONNECTION could logically
> >> be a
> >> > > catalog-level resource, especially since it’s intended to be reused
> >> > across
> >> > > multiple tables. However, we think there’s value in defining it at
> the
> >> > > database level to introduce a layer of isolation and scoping.
> >> > >
> >> > > This is particularly useful in shared or multi-tenant environments
> >> where
> >> > > different databases within the same catalog might need to connect to
> >> > > different external systems or use distinct credentials.
> >> > >
> >> > > That said, we’re open to revisiting this if there's strong consensus
> >> > around
> >> > > catalog-level scoping. Appreciate the feedback!
> >> > >
> >> > > Regards,
> >> > > Mayank
> >> > >
> >> > > On Fri, May 2, 2025 at 12:12 AM Ferenc Csaky
> >> <ferenc.csaky@pm.me.invalid
> >> > >
> >> > > wrote:
> >> > >
> >> > > > Hi Mayank,
> >> > > >
> >> > > > Thank you for starting the discussion! In general, I think such
> >> > > > functionality
> >> > > > would be a really great addition to Flink.
> >> > > >
> >> > > > Could you pls. elaborate a bit more one what is the reason of
> >> defining
> >> > a
> >> > > > `connection` resource on the database level instead of the catalog
> >> > level?
> >> > > > If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is
> in
> >> > > 1-to-1
> >> > > > mapping with an RDBMS, or a HiveMetastore, so my initial thinking
> is
> >> > > that a
> >> > > > `connection` seems more like a catalog level resource.
> >> > > >
> >> > > > WDYT?
> >> > > >
> >> > > > Thanks,
> >> > > > Ferenc
> >> > > >
> >> > > >
> >> > > >
> >> > > > On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
> >> > > > mayankjuneja27@gmail.com> wrote:
> >> > > >
> >> > > > >
> >> > > > >
> >> > > > > Hi all,
> >> > > > >
> >> > > > > I would like to open up for discussion a new FLIP-529 [1].
> >> > > > >
> >> > > > > Motivation:
> >> > > > > Currently, Flink SQL handles external connectivity by defining
> >> > > endpoints
> >> > > > > and credentials in table configuration. This approach prevents
> >> > > > reusability
> >> > > > > of these connections and makes table definition less secure by
> >> > exposing
> >> > > > > sensitive information.
> >> > > > > We propose the introduction of a new "connection" resource in
> >> Flink.
> >> > > This
> >> > > > > will be a pluggable resource configured with a remote endpoint
> and
> >> > > > > associated access key. Once defined, connections can be reused
> >> across
> >> > > > table
> >> > > > > definitions, and eventually for model definition (as discussed
> in
> >> > > > FLIP-437)
> >> > > > > for inference, enabling seamless and secure integration with
> >> external
> >> > > > > systems.
> >> > > > > The connection resource will provide a new, optional way to
> manage
> >> > > > external
> >> > > > > connectivity in Flink. Existing methods for table definitions
> will
> >> > > remain
> >> > > > > unchanged.
> >> > > > >
> >> > > > > [1] https://cwiki.apache.org/confluence/x/cYroF
> >> > > > >
> >> > > > > Best Regards,
> >> > > > > Mayank Juneja
> >> > > >
> >> > >
> >> > >
> >> > > --
> >> > > *Mayank Juneja*
> >> > > Product Manager | Data Streaming and AI
> >> > >
> >> >
> >>
> >
> >
> > --
> > *Mayank Juneja*
> > Product Manager | Data Streaming and AI
> >
>
>
> --
> *Mayank Juneja*
> Product Manager | Data Streaming and AI
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Mayank Juneja <ma...@gmail.com>.
Thanks all for the feedback on the FLIP. If there are no more discussions,
I will start voting on this tomorrow.

On Wed, May 21, 2025 at 6:00 AM Mayank Juneja <ma...@gmail.com>
wrote:

> Hi Ryan,
>
> Thanks for the feedback.
>
> Just a quick clarification—DESCRIBE TABLE in Flink does *not* show table
> properties; I believe you might be thinking of SHOW CREATE TABLE, which
> does include properties as part of the DDL output. The goal of SHOW
> CREATE TABLE is to provide a fully reproducible statement, so if secrets
> were hidden or omitted, that reproducibility would be lost. By referencing
> a named CONNECTION, we avoid this issue—users can reconstruct the table
> DDL without exposing secrets directly, since the sensitive information
> lives in the reusable connection object.
>
> Regarding the naming: CONNECTION is not part of the SQL standard, but
> neither are alternatives like SECRET or INTEGRATION. We opted for
> CONNECTION because it conveys intent clearly and aligns with common
> terminology in data platforms, even if it's not a standard keyword.
>
> That said, we're definitely open to refining the naming based on broader
> community input. Appreciate you raising these points and helping move the
> conversation forward.
>
> Best,
> Mayank
>
> On Fri, May 16, 2025 at 7:15 PM Ryan van Huuksloot
> <ry...@shopify.com.invalid> wrote:
>
>> Hi Mayank,
>>
>> Overall I think the idea of having shared properties (secrets or
>> otherwise)
>> at the database layer is really interesting/useful. Even outside of the ML
>> scope.
>>
>> However, I have a concern:
>> When I describe a table, I would not like it if all properties did not
>> appear in the returned results of the describe. It adds a hidden layer of
>> properties.
>> CONNECTION is not a standard SQL syntax (at least that I am aware of,
>> please correct me if I am wrong) and it adds a FlinkSQL specific layer of
>> complexity.
>>
>> I like the idea of Grants to hide secrets rather than nesting them in a
>> Connection object. The Connection object could still be described.
>> Something akin to Snowflake's Secrets (
>> https://docs.snowflake.com/en/sql-reference/sql/show-secrets) that can be
>> referenced within table properties and could be obfuscated during a
>> describe.
>>
>> Then if we hide secrets, we can figure out a different name than
>> Connection
>> for common properties and they can be shown as part of the table spec.
>>
>> Thoughts?
>>
>> Ryan van Huuksloot
>> Sr. Production Engineer | Streaming Platform
>> [image: Shopify]
>> <https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>
>>
>>
>> On Fri, May 16, 2025 at 1:35 PM Yash Anand <ya...@confluent.io.invalid>
>> wrote:
>>
>> > Hi Mayank,
>> >
>> > Thanks for the initiative! I think this functionality would be a really
>> > great addition to Flink.
>> >
>> > +1 for the proposal.
>> >
>> > Thanks,
>> > Yash
>> >
>> > On Tue, May 6, 2025 at 9:36 AM Mayank Juneja <ma...@gmail.com>
>> > wrote:
>> >
>> > > Hi Ferenc,
>> > >
>> > > Thanks for your question! We agree that a CONNECTION could logically
>> be a
>> > > catalog-level resource, especially since it’s intended to be reused
>> > across
>> > > multiple tables. However, we think there’s value in defining it at the
>> > > database level to introduce a layer of isolation and scoping.
>> > >
>> > > This is particularly useful in shared or multi-tenant environments
>> where
>> > > different databases within the same catalog might need to connect to
>> > > different external systems or use distinct credentials.
>> > >
>> > > That said, we’re open to revisiting this if there's strong consensus
>> > around
>> > > catalog-level scoping. Appreciate the feedback!
>> > >
>> > > Regards,
>> > > Mayank
>> > >
>> > > On Fri, May 2, 2025 at 12:12 AM Ferenc Csaky
>> <ferenc.csaky@pm.me.invalid
>> > >
>> > > wrote:
>> > >
>> > > > Hi Mayank,
>> > > >
>> > > > Thank you for starting the discussion! In general, I think such
>> > > > functionality
>> > > > would be a really great addition to Flink.
>> > > >
>> > > > Could you pls. elaborate a bit more one what is the reason of
>> defining
>> > a
>> > > > `connection` resource on the database level instead of the catalog
>> > level?
>> > > > If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in
>> > > 1-to-1
>> > > > mapping with an RDBMS, or a HiveMetastore, so my initial thinking is
>> > > that a
>> > > > `connection` seems more like a catalog level resource.
>> > > >
>> > > > WDYT?
>> > > >
>> > > > Thanks,
>> > > > Ferenc
>> > > >
>> > > >
>> > > >
>> > > > On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
>> > > > mayankjuneja27@gmail.com> wrote:
>> > > >
>> > > > >
>> > > > >
>> > > > > Hi all,
>> > > > >
>> > > > > I would like to open up for discussion a new FLIP-529 [1].
>> > > > >
>> > > > > Motivation:
>> > > > > Currently, Flink SQL handles external connectivity by defining
>> > > endpoints
>> > > > > and credentials in table configuration. This approach prevents
>> > > > reusability
>> > > > > of these connections and makes table definition less secure by
>> > exposing
>> > > > > sensitive information.
>> > > > > We propose the introduction of a new "connection" resource in
>> Flink.
>> > > This
>> > > > > will be a pluggable resource configured with a remote endpoint and
>> > > > > associated access key. Once defined, connections can be reused
>> across
>> > > > table
>> > > > > definitions, and eventually for model definition (as discussed in
>> > > > FLIP-437)
>> > > > > for inference, enabling seamless and secure integration with
>> external
>> > > > > systems.
>> > > > > The connection resource will provide a new, optional way to manage
>> > > > external
>> > > > > connectivity in Flink. Existing methods for table definitions will
>> > > remain
>> > > > > unchanged.
>> > > > >
>> > > > > [1] https://cwiki.apache.org/confluence/x/cYroF
>> > > > >
>> > > > > Best Regards,
>> > > > > Mayank Juneja
>> > > >
>> > >
>> > >
>> > > --
>> > > *Mayank Juneja*
>> > > Product Manager | Data Streaming and AI
>> > >
>> >
>>
>
>
> --
> *Mayank Juneja*
> Product Manager | Data Streaming and AI
>


-- 
*Mayank Juneja*
Product Manager | Data Streaming and AI

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Mayank Juneja <ma...@gmail.com>.
Hi Ryan,

Thanks for the feedback.

Just a quick clarification—DESCRIBE TABLE in Flink does *not* show table
properties; I believe you might be thinking of SHOW CREATE TABLE, which
does include properties as part of the DDL output. The goal of SHOW CREATE
TABLE is to provide a fully reproducible statement, so if secrets were
hidden or omitted, that reproducibility would be lost. By referencing a
named CONNECTION, we avoid this issue—users can reconstruct the table DDL
without exposing secrets directly, since the sensitive information lives in
the reusable connection object.

Regarding the naming: CONNECTION is not part of the SQL standard, but
neither are alternatives like SECRET or INTEGRATION. We opted for CONNECTION
because it conveys intent clearly and aligns with common terminology in
data platforms, even if it's not a standard keyword.

That said, we're definitely open to refining the naming based on broader
community input. Appreciate you raising these points and helping move the
conversation forward.

Best,
Mayank

On Fri, May 16, 2025 at 7:15 PM Ryan van Huuksloot
<ry...@shopify.com.invalid> wrote:

> Hi Mayank,
>
> Overall I think the idea of having shared properties (secrets or otherwise)
> at the database layer is really interesting/useful. Even outside of the ML
> scope.
>
> However, I have a concern:
> When I describe a table, I would not like it if all properties did not
> appear in the returned results of the describe. It adds a hidden layer of
> properties.
> CONNECTION is not a standard SQL syntax (at least that I am aware of,
> please correct me if I am wrong) and it adds a FlinkSQL specific layer of
> complexity.
>
> I like the idea of Grants to hide secrets rather than nesting them in a
> Connection object. The Connection object could still be described.
> Something akin to Snowflake's Secrets (
> https://docs.snowflake.com/en/sql-reference/sql/show-secrets) that can be
> referenced within table properties and could be obfuscated during a
> describe.
>
> Then if we hide secrets, we can figure out a different name than Connection
> for common properties and they can be shown as part of the table spec.
>
> Thoughts?
>
> Ryan van Huuksloot
> Sr. Production Engineer | Streaming Platform
> [image: Shopify]
> <https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>
>
>
> On Fri, May 16, 2025 at 1:35 PM Yash Anand <ya...@confluent.io.invalid>
> wrote:
>
> > Hi Mayank,
> >
> > Thanks for the initiative! I think this functionality would be a really
> > great addition to Flink.
> >
> > +1 for the proposal.
> >
> > Thanks,
> > Yash
> >
> > On Tue, May 6, 2025 at 9:36 AM Mayank Juneja <ma...@gmail.com>
> > wrote:
> >
> > > Hi Ferenc,
> > >
> > > Thanks for your question! We agree that a CONNECTION could logically
> be a
> > > catalog-level resource, especially since it’s intended to be reused
> > across
> > > multiple tables. However, we think there’s value in defining it at the
> > > database level to introduce a layer of isolation and scoping.
> > >
> > > This is particularly useful in shared or multi-tenant environments
> where
> > > different databases within the same catalog might need to connect to
> > > different external systems or use distinct credentials.
> > >
> > > That said, we’re open to revisiting this if there's strong consensus
> > around
> > > catalog-level scoping. Appreciate the feedback!
> > >
> > > Regards,
> > > Mayank
> > >
> > > On Fri, May 2, 2025 at 12:12 AM Ferenc Csaky
> <ferenc.csaky@pm.me.invalid
> > >
> > > wrote:
> > >
> > > > Hi Mayank,
> > > >
> > > > Thank you for starting the discussion! In general, I think such
> > > > functionality
> > > > would be a really great addition to Flink.
> > > >
> > > > Could you pls. elaborate a bit more one what is the reason of
> defining
> > a
> > > > `connection` resource on the database level instead of the catalog
> > level?
> > > > If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in
> > > 1-to-1
> > > > mapping with an RDBMS, or a HiveMetastore, so my initial thinking is
> > > that a
> > > > `connection` seems more like a catalog level resource.
> > > >
> > > > WDYT?
> > > >
> > > > Thanks,
> > > > Ferenc
> > > >
> > > >
> > > >
> > > > On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
> > > > mayankjuneja27@gmail.com> wrote:
> > > >
> > > > >
> > > > >
> > > > > Hi all,
> > > > >
> > > > > I would like to open up for discussion a new FLIP-529 [1].
> > > > >
> > > > > Motivation:
> > > > > Currently, Flink SQL handles external connectivity by defining
> > > endpoints
> > > > > and credentials in table configuration. This approach prevents
> > > > reusability
> > > > > of these connections and makes table definition less secure by
> > exposing
> > > > > sensitive information.
> > > > > We propose the introduction of a new "connection" resource in
> Flink.
> > > This
> > > > > will be a pluggable resource configured with a remote endpoint and
> > > > > associated access key. Once defined, connections can be reused
> across
> > > > table
> > > > > definitions, and eventually for model definition (as discussed in
> > > > FLIP-437)
> > > > > for inference, enabling seamless and secure integration with
> external
> > > > > systems.
> > > > > The connection resource will provide a new, optional way to manage
> > > > external
> > > > > connectivity in Flink. Existing methods for table definitions will
> > > remain
> > > > > unchanged.
> > > > >
> > > > > [1] https://cwiki.apache.org/confluence/x/cYroF
> > > > >
> > > > > Best Regards,
> > > > > Mayank Juneja
> > > >
> > >
> > >
> > > --
> > > *Mayank Juneja*
> > > Product Manager | Data Streaming and AI
> > >
> >
>


-- 
*Mayank Juneja*
Product Manager | Data Streaming and AI

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Ryan van Huuksloot <ry...@shopify.com.INVALID>.
Hi Mayank,

Overall I think the idea of having shared properties (secrets or otherwise)
at the database layer is really interesting/useful. Even outside of the ML
scope.

However, I have a concern:
When I describe a table, I would not like it if all properties did not
appear in the returned results of the describe. It adds a hidden layer of
properties.
CONNECTION is not a standard SQL syntax (at least that I am aware of,
please correct me if I am wrong) and it adds a FlinkSQL specific layer of
complexity.

I like the idea of Grants to hide secrets rather than nesting them in a
Connection object. The Connection object could still be described.
Something akin to Snowflake's Secrets (
https://docs.snowflake.com/en/sql-reference/sql/show-secrets) that can be
referenced within table properties and could be obfuscated during a
describe.

Then if we hide secrets, we can figure out a different name than Connection
for common properties and they can be shown as part of the table spec.

Thoughts?

Ryan van Huuksloot
Sr. Production Engineer | Streaming Platform
[image: Shopify]
<https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>


On Fri, May 16, 2025 at 1:35 PM Yash Anand <ya...@confluent.io.invalid>
wrote:

> Hi Mayank,
>
> Thanks for the initiative! I think this functionality would be a really
> great addition to Flink.
>
> +1 for the proposal.
>
> Thanks,
> Yash
>
> On Tue, May 6, 2025 at 9:36 AM Mayank Juneja <ma...@gmail.com>
> wrote:
>
> > Hi Ferenc,
> >
> > Thanks for your question! We agree that a CONNECTION could logically be a
> > catalog-level resource, especially since it’s intended to be reused
> across
> > multiple tables. However, we think there’s value in defining it at the
> > database level to introduce a layer of isolation and scoping.
> >
> > This is particularly useful in shared or multi-tenant environments where
> > different databases within the same catalog might need to connect to
> > different external systems or use distinct credentials.
> >
> > That said, we’re open to revisiting this if there's strong consensus
> around
> > catalog-level scoping. Appreciate the feedback!
> >
> > Regards,
> > Mayank
> >
> > On Fri, May 2, 2025 at 12:12 AM Ferenc Csaky <ferenc.csaky@pm.me.invalid
> >
> > wrote:
> >
> > > Hi Mayank,
> > >
> > > Thank you for starting the discussion! In general, I think such
> > > functionality
> > > would be a really great addition to Flink.
> > >
> > > Could you pls. elaborate a bit more one what is the reason of defining
> a
> > > `connection` resource on the database level instead of the catalog
> level?
> > > If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in
> > 1-to-1
> > > mapping with an RDBMS, or a HiveMetastore, so my initial thinking is
> > that a
> > > `connection` seems more like a catalog level resource.
> > >
> > > WDYT?
> > >
> > > Thanks,
> > > Ferenc
> > >
> > >
> > >
> > > On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
> > > mayankjuneja27@gmail.com> wrote:
> > >
> > > >
> > > >
> > > > Hi all,
> > > >
> > > > I would like to open up for discussion a new FLIP-529 [1].
> > > >
> > > > Motivation:
> > > > Currently, Flink SQL handles external connectivity by defining
> > endpoints
> > > > and credentials in table configuration. This approach prevents
> > > reusability
> > > > of these connections and makes table definition less secure by
> exposing
> > > > sensitive information.
> > > > We propose the introduction of a new "connection" resource in Flink.
> > This
> > > > will be a pluggable resource configured with a remote endpoint and
> > > > associated access key. Once defined, connections can be reused across
> > > table
> > > > definitions, and eventually for model definition (as discussed in
> > > FLIP-437)
> > > > for inference, enabling seamless and secure integration with external
> > > > systems.
> > > > The connection resource will provide a new, optional way to manage
> > > external
> > > > connectivity in Flink. Existing methods for table definitions will
> > remain
> > > > unchanged.
> > > >
> > > > [1] https://cwiki.apache.org/confluence/x/cYroF
> > > >
> > > > Best Regards,
> > > > Mayank Juneja
> > >
> >
> >
> > --
> > *Mayank Juneja*
> > Product Manager | Data Streaming and AI
> >
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Yash Anand <ya...@confluent.io.INVALID>.
Hi Mayank,

Thanks for the initiative! I think this functionality would be a really
great addition to Flink.

+1 for the proposal.

Thanks,
Yash

On Tue, May 6, 2025 at 9:36 AM Mayank Juneja <ma...@gmail.com>
wrote:

> Hi Ferenc,
>
> Thanks for your question! We agree that a CONNECTION could logically be a
> catalog-level resource, especially since it’s intended to be reused across
> multiple tables. However, we think there’s value in defining it at the
> database level to introduce a layer of isolation and scoping.
>
> This is particularly useful in shared or multi-tenant environments where
> different databases within the same catalog might need to connect to
> different external systems or use distinct credentials.
>
> That said, we’re open to revisiting this if there's strong consensus around
> catalog-level scoping. Appreciate the feedback!
>
> Regards,
> Mayank
>
> On Fri, May 2, 2025 at 12:12 AM Ferenc Csaky <fe...@pm.me.invalid>
> wrote:
>
> > Hi Mayank,
> >
> > Thank you for starting the discussion! In general, I think such
> > functionality
> > would be a really great addition to Flink.
> >
> > Could you pls. elaborate a bit more one what is the reason of defining a
> > `connection` resource on the database level instead of the catalog level?
> > If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in
> 1-to-1
> > mapping with an RDBMS, or a HiveMetastore, so my initial thinking is
> that a
> > `connection` seems more like a catalog level resource.
> >
> > WDYT?
> >
> > Thanks,
> > Ferenc
> >
> >
> >
> > On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
> > mayankjuneja27@gmail.com> wrote:
> >
> > >
> > >
> > > Hi all,
> > >
> > > I would like to open up for discussion a new FLIP-529 [1].
> > >
> > > Motivation:
> > > Currently, Flink SQL handles external connectivity by defining
> endpoints
> > > and credentials in table configuration. This approach prevents
> > reusability
> > > of these connections and makes table definition less secure by exposing
> > > sensitive information.
> > > We propose the introduction of a new "connection" resource in Flink.
> This
> > > will be a pluggable resource configured with a remote endpoint and
> > > associated access key. Once defined, connections can be reused across
> > table
> > > definitions, and eventually for model definition (as discussed in
> > FLIP-437)
> > > for inference, enabling seamless and secure integration with external
> > > systems.
> > > The connection resource will provide a new, optional way to manage
> > external
> > > connectivity in Flink. Existing methods for table definitions will
> remain
> > > unchanged.
> > >
> > > [1] https://cwiki.apache.org/confluence/x/cYroF
> > >
> > > Best Regards,
> > > Mayank Juneja
> >
>
>
> --
> *Mayank Juneja*
> Product Manager | Data Streaming and AI
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Mayank Juneja <ma...@gmail.com>.
Hi Ferenc,

Thanks for your question! We agree that a CONNECTION could logically be a
catalog-level resource, especially since it’s intended to be reused across
multiple tables. However, we think there’s value in defining it at the
database level to introduce a layer of isolation and scoping.

This is particularly useful in shared or multi-tenant environments where
different databases within the same catalog might need to connect to
different external systems or use distinct credentials.

That said, we’re open to revisiting this if there's strong consensus around
catalog-level scoping. Appreciate the feedback!

Regards,
Mayank

On Fri, May 2, 2025 at 12:12 AM Ferenc Csaky <fe...@pm.me.invalid>
wrote:

> Hi Mayank,
>
> Thank you for starting the discussion! In general, I think such
> functionality
> would be a really great addition to Flink.
>
> Could you pls. elaborate a bit more one what is the reason of defining a
> `connection` resource on the database level instead of the catalog level?
> If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in 1-to-1
> mapping with an RDBMS, or a HiveMetastore, so my initial thinking is that a
> `connection` seems more like a catalog level resource.
>
> WDYT?
>
> Thanks,
> Ferenc
>
>
>
> On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
> mayankjuneja27@gmail.com> wrote:
>
> >
> >
> > Hi all,
> >
> > I would like to open up for discussion a new FLIP-529 [1].
> >
> > Motivation:
> > Currently, Flink SQL handles external connectivity by defining endpoints
> > and credentials in table configuration. This approach prevents
> reusability
> > of these connections and makes table definition less secure by exposing
> > sensitive information.
> > We propose the introduction of a new "connection" resource in Flink. This
> > will be a pluggable resource configured with a remote endpoint and
> > associated access key. Once defined, connections can be reused across
> table
> > definitions, and eventually for model definition (as discussed in
> FLIP-437)
> > for inference, enabling seamless and secure integration with external
> > systems.
> > The connection resource will provide a new, optional way to manage
> external
> > connectivity in Flink. Existing methods for table definitions will remain
> > unchanged.
> >
> > [1] https://cwiki.apache.org/confluence/x/cYroF
> >
> > Best Regards,
> > Mayank Juneja
>


-- 
*Mayank Juneja*
Product Manager | Data Streaming and AI

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hao Li <hl...@confluent.io.INVALID>.
Thanks Mayank for the proposal. I think it's a great addition to Flink to
define secure connectivity in general for table, model and other resources
later on. +1.

Hao

On Fri, May 2, 2025 at 5:32 AM Gustavo de Morais <gu...@gmail.com>
wrote:

> Hi Mayank,
>
> Thanks for the initiative. Looking at the FLIP, this looks like a
> well-thought-out proposal that addresses a clear need for more secure and
> reusable external connections in Flink SQL and Table API. Separating
> connection details would a valuable improvement.
>
> Best Regards,
> Gustavo
>
> Am Fr., 2. Mai 2025 um 07:12 Uhr schrieb Ferenc Csaky
> <fe...@pm.me.invalid>:
>
> > Hi Mayank,
> >
> > Thank you for starting the discussion! In general, I think such
> > functionality
> > would be a really great addition to Flink.
> >
> > Could you pls. elaborate a bit more one what is the reason of defining a
> > `connection` resource on the database level instead of the catalog level?
> > If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in
> 1-to-1
> > mapping with an RDBMS, or a HiveMetastore, so my initial thinking is
> that a
> > `connection` seems more like a catalog level resource.
> >
> > WDYT?
> >
> > Thanks,
> > Ferenc
> >
> >
> >
> > On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
> > mayankjuneja27@gmail.com> wrote:
> >
> > >
> > >
> > > Hi all,
> > >
> > > I would like to open up for discussion a new FLIP-529 [1].
> > >
> > > Motivation:
> > > Currently, Flink SQL handles external connectivity by defining
> endpoints
> > > and credentials in table configuration. This approach prevents
> > reusability
> > > of these connections and makes table definition less secure by exposing
> > > sensitive information.
> > > We propose the introduction of a new "connection" resource in Flink.
> This
> > > will be a pluggable resource configured with a remote endpoint and
> > > associated access key. Once defined, connections can be reused across
> > table
> > > definitions, and eventually for model definition (as discussed in
> > FLIP-437)
> > > for inference, enabling seamless and secure integration with external
> > > systems.
> > > The connection resource will provide a new, optional way to manage
> > external
> > > connectivity in Flink. Existing methods for table definitions will
> remain
> > > unchanged.
> > >
> > > [1] https://cwiki.apache.org/confluence/x/cYroF
> > >
> > > Best Regards,
> > > Mayank Juneja
> >
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Gustavo de Morais <gu...@gmail.com>.
Hi Mayank,

Thanks for the initiative. Looking at the FLIP, this looks like a
well-thought-out proposal that addresses a clear need for more secure and
reusable external connections in Flink SQL and Table API. Separating
connection details would a valuable improvement.

Best Regards,
Gustavo

Am Fr., 2. Mai 2025 um 07:12 Uhr schrieb Ferenc Csaky
<fe...@pm.me.invalid>:

> Hi Mayank,
>
> Thank you for starting the discussion! In general, I think such
> functionality
> would be a really great addition to Flink.
>
> Could you pls. elaborate a bit more one what is the reason of defining a
> `connection` resource on the database level instead of the catalog level?
> If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in 1-to-1
> mapping with an RDBMS, or a HiveMetastore, so my initial thinking is that a
> `connection` seems more like a catalog level resource.
>
> WDYT?
>
> Thanks,
> Ferenc
>
>
>
> On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <
> mayankjuneja27@gmail.com> wrote:
>
> >
> >
> > Hi all,
> >
> > I would like to open up for discussion a new FLIP-529 [1].
> >
> > Motivation:
> > Currently, Flink SQL handles external connectivity by defining endpoints
> > and credentials in table configuration. This approach prevents
> reusability
> > of these connections and makes table definition less secure by exposing
> > sensitive information.
> > We propose the introduction of a new "connection" resource in Flink. This
> > will be a pluggable resource configured with a remote endpoint and
> > associated access key. Once defined, connections can be reused across
> table
> > definitions, and eventually for model definition (as discussed in
> FLIP-437)
> > for inference, enabling seamless and secure integration with external
> > systems.
> > The connection resource will provide a new, optional way to manage
> external
> > connectivity in Flink. Existing methods for table definitions will remain
> > unchanged.
> >
> > [1] https://cwiki.apache.org/confluence/x/cYroF
> >
> > Best Regards,
> > Mayank Juneja
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Ferenc Csaky <fe...@pm.me.INVALID>.
Hi Mayank,

Thank you for starting the discussion! In general, I think such functionality
would be a really great addition to Flink.

Could you pls. elaborate a bit more one what is the reason of defining a
`connection` resource on the database level instead of the catalog level?
If I think about `JdbcCatalog`, or `HiveCatalog`, the catalog is in 1-to-1
mapping with an RDBMS, or a HiveMetastore, so my initial thinking is that a
`connection` seems more like a catalog level resource.

WDYT?

Thanks,
Ferenc



On Tuesday, April 29th, 2025 at 17:08, Mayank Juneja <ma...@gmail.com> wrote:

> 
> 
> Hi all,
> 
> I would like to open up for discussion a new FLIP-529 [1].
> 
> Motivation:
> Currently, Flink SQL handles external connectivity by defining endpoints
> and credentials in table configuration. This approach prevents reusability
> of these connections and makes table definition less secure by exposing
> sensitive information.
> We propose the introduction of a new "connection" resource in Flink. This
> will be a pluggable resource configured with a remote endpoint and
> associated access key. Once defined, connections can be reused across table
> definitions, and eventually for model definition (as discussed in FLIP-437)
> for inference, enabling seamless and secure integration with external
> systems.
> The connection resource will provide a new, optional way to manage external
> connectivity in Flink. Existing methods for table definitions will remain
> unchanged.
> 
> [1] https://cwiki.apache.org/confluence/x/cYroF
> 
> Best Regards,
> Mayank Juneja

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Shengkai Fang <fs...@gmail.com>.
Thanks for Mayank's proposal!

My bad! I had the wrong person listed as the initiator.

Best,
Shengkai

Shengkai Fang <fs...@gmail.com> 于2025年6月4日周三 12:07写道:

> Hi, LiHao.
>
> Thanks for the proposal. The idea of connection is very attractive and
> really helps Flink users to manage their secret. But I have some concerns
> about this FLIP:
>
> *Proposal for a Top-Level Connection Concept in Flink SQL*
> I believe connection should be elevated as a core, top-level concept in
> Flink SQL. This would allow users to leverage connection metadata to create
> catalogs, tables, and other resources, as both catalogs and tables
> inherently require external system integrations. To streamline management,
> introducing a connection store to securely organize and access all
> connections/secrets could be a valuable addition.
>
> *Improving Syntax Clarity for Connection References*
> The current syntax for referencing connections feels overly implicit. +1
> with @Ryan's proposal to use SQL to specify connections explicitly.
> However, I recommend conducting a deeper analysis of existing use cases and
> community feedback to ensure this aligns with user expectations and broader
> design goals.
>
> Best,
> Shengkai
>
> Martijn Visser <ma...@apache.org> 于2025年6月4日周三 02:04写道:
>
>> Hi all,
>>
>> First of all, I think having a Connection resource is something that will
>> be beneficial for Apache Flink. I could see that being extended in the
>> future to allow for easier secret handling [1].
>> In my mental mind, I'm comparing this proposal against SQL/MED from the
>> ISO
>> standard [2]. I do think that SQL/MED isn't a very user friendly syntax
>> though, looking at Postgres for example [3].
>>
>> I think it's a valid question if Connection should be considered with a
>> catalog or database-level scope. @Ryan can you share something more, since
>> you've mentioned "Note: I much prefer catalogs for this case. Which is
>> what
>> we use internally to manage connection properties". It looks like there
>> isn't a strong favourable approach looking at other vendors (like,
>> Databricks does scopes it on a Unity catalog, Snowflake on a database
>> level).
>>
>> Also looking forward to Leonard's input.
>>
>> Best regards,
>>
>> Martijn
>>
>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>> [2] https://www.iso.org/standard/84804.html
>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
>>
>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
>>
>> > Hey Mayank.
>> >
>> > Thanks for the FLIP, I went through this FLIP quickly and found some
>> > issues which I think we
>> > need to deep discuss later. As we’re on a short Dragon boat Festival,
>> > could you kindly hold
>> > on this thread? and we will back to continue the FLIP discuss.
>> >
>> > Best,
>> > Leonard
>> >
>> >
>> > > 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
>> > >
>> > > Hi all,
>> > >
>> > > I would like to open up for discussion a new FLIP-529 [1].
>> > >
>> > > Motivation:
>> > > Currently, Flink SQL handles external connectivity by defining
>> endpoints
>> > > and credentials in table configuration. This approach prevents
>> > reusability
>> > > of these connections and makes table definition less secure by
>> exposing
>> > > sensitive information.
>> > > We propose the introduction of a new "connection" resource in Flink.
>> This
>> > > will be a pluggable resource configured with a remote endpoint and
>> > > associated access key. Once defined, connections can be reused across
>> > table
>> > > definitions, and eventually for model definition (as discussed in
>> > FLIP-437)
>> > > for inference, enabling seamless and secure integration with external
>> > > systems.
>> > > The connection resource will provide a new, optional way to manage
>> > external
>> > > connectivity in Flink. Existing methods for table definitions will
>> remain
>> > > unchanged.
>> > >
>> > > [1] https://cwiki.apache.org/confluence/x/cYroF
>> > >
>> > > Best Regards,
>> > > Mayank Juneja
>> >
>> >
>>
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Shengkai Fang <fs...@gmail.com>.
Hi, LiHao.

Thanks for the proposal. The idea of connection is very attractive and
really helps Flink users to manage their secret. But I have some concerns
about this FLIP:

*Proposal for a Top-Level Connection Concept in Flink SQL*
I believe connection should be elevated as a core, top-level concept in
Flink SQL. This would allow users to leverage connection metadata to create
catalogs, tables, and other resources, as both catalogs and tables
inherently require external system integrations. To streamline management,
introducing a connection store to securely organize and access all
connections/secrets could be a valuable addition.

*Improving Syntax Clarity for Connection References*
The current syntax for referencing connections feels overly implicit. +1
with @Ryan's proposal to use SQL to specify connections explicitly.
However, I recommend conducting a deeper analysis of existing use cases and
community feedback to ensure this aligns with user expectations and broader
design goals.

Best,
Shengkai

Martijn Visser <ma...@apache.org> 于2025年6月4日周三 02:04写道:

> Hi all,
>
> First of all, I think having a Connection resource is something that will
> be beneficial for Apache Flink. I could see that being extended in the
> future to allow for easier secret handling [1].
> In my mental mind, I'm comparing this proposal against SQL/MED from the ISO
> standard [2]. I do think that SQL/MED isn't a very user friendly syntax
> though, looking at Postgres for example [3].
>
> I think it's a valid question if Connection should be considered with a
> catalog or database-level scope. @Ryan can you share something more, since
> you've mentioned "Note: I much prefer catalogs for this case. Which is what
> we use internally to manage connection properties". It looks like there
> isn't a strong favourable approach looking at other vendors (like,
> Databricks does scopes it on a Unity catalog, Snowflake on a database
> level).
>
> Also looking forward to Leonard's input.
>
> Best regards,
>
> Martijn
>
> [1] https://issues.apache.org/jira/browse/FLINK-36818
> [2] https://www.iso.org/standard/84804.html
> [3] https://www.postgresql.org/docs/current/sql-createserver.html
>
> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
>
> > Hey Mayank.
> >
> > Thanks for the FLIP, I went through this FLIP quickly and found some
> > issues which I think we
> > need to deep discuss later. As we’re on a short Dragon boat Festival,
> > could you kindly hold
> > on this thread? and we will back to continue the FLIP discuss.
> >
> > Best,
> > Leonard
> >
> >
> > > 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> > >
> > > Hi all,
> > >
> > > I would like to open up for discussion a new FLIP-529 [1].
> > >
> > > Motivation:
> > > Currently, Flink SQL handles external connectivity by defining
> endpoints
> > > and credentials in table configuration. This approach prevents
> > reusability
> > > of these connections and makes table definition less secure by exposing
> > > sensitive information.
> > > We propose the introduction of a new "connection" resource in Flink.
> This
> > > will be a pluggable resource configured with a remote endpoint and
> > > associated access key. Once defined, connections can be reused across
> > table
> > > definitions, and eventually for model definition (as discussed in
> > FLIP-437)
> > > for inference, enabling seamless and secure integration with external
> > > systems.
> > > The connection resource will provide a new, optional way to manage
> > external
> > > connectivity in Flink. Existing methods for table definitions will
> remain
> > > unchanged.
> > >
> > > [1] https://cwiki.apache.org/confluence/x/cYroF
> > >
> > > Best Regards,
> > > Mayank Juneja
> >
> >
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Ryan van Huuksloot <ry...@shopify.com.INVALID>.
Hi everyone,

Thanks Timo + company, for the updated proposal. From my perspective, the
systems and syntaxes proposed are much better. It still allows for the
functionality required but has better segregation of duties.Would love to
see an updated FLIP.

Would it be worth splitting the proposal into a FLIP for the SecretStore
and one for the Connection Object?

Ryan van Huuksloot
Sr. Production Engineer | Streaming Platform
[image: Shopify]
<https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>


On Thu, Jun 26, 2025 at 3:07 AM Timo Walther <tw...@apache.org> wrote:

> Hi everyone,
>
> sorry for the late reply, feature freeze kept me busy. Mayank, Hao and I
> synced offline and came up we an improved proposal. Before we update the
> FLIP let me summarize the most important key facts that hopefully
> address most concerns:
>
> 1) SecretStore
> - Similar to CatalogStore, we introduce a SecretStore as the highest
> level in TableEnvironment.
> - SecretStore is initialized with options and potentially environment
> variables. Including EnvironmentSettings.withSecretStore(SecretStore).
> - The SecretStore is pluggable and discovered using the regular
> factory-approach.
> - For example, it could implement Azure Key Vault or other cloud
> provider secrets stores.
> - Goal: Flink and Flink catalogs do not have to deal with sensitive data.
>
> 2) Connections
> - Connections are catalog objects identified with 3-part identifiers.
> 3-part identifiers are crucial for managability of larger projects and
> align with existing catalog objects.
> - They contain connection details, e.g. URL, query parameters, and other
> configuration.
> - They do not contain secrets, but only pointers to secrets in the
> SecretStore.
>
> 3) Connection DDL
>
> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>    'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>    ...
> )
>
> - Connection type is pluggable and discovered using the regular
> factory-approach.
> - The factory extracts secrets and puts them into SecretStore.
> - The factory only leaves non-confidential options left that can be
> stored in a catalog.
>
> When executing:
> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>    'type' = 'basic',
>    'url' = 'api.example.com',
>    'username' = 'bob',
>    'password' = 'xyz'
> )
>
> The catalog will receive something similar to:
> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>    'type' = 'basic',
>    'url' = 'api.example.com',
>    'secret.store' = 'azure-key-vault'
>    'secret.id' = 'secretId'
> )
>
> - However, the exact property design is up to the connection factory.
>
> 4) Connection Usage
>
> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
>
> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
> similar to BigQuery.
> - The connection will be provided in a table/model provider/function
> definition factory.
>
> 5) CatalogStore / Catalog Initialization
>
> Catalog store or catalog can make use of SecretStore to retrieve initial
> credentials for bootstrapping. All objects lower then catalog
> store/catalog can then use connections. If you think we still need
> system level connections, we can support CREATE SYSTEM CONNECTION
> GlobalName WITH (..) similar to SYSTEM functions directly store in a
> ConnectioManager in TableEnvironment. But for now I would suggest to
> start simple with per-catalog connections and later evolve the design.
>
> Dealing with secrets is a very sensitive topic and I'm clearly not an
> expert on it. This is why we should try to push the problem to existing
> solutions and don't start storing secrets in Flink in any way. Thus, the
> interfaces will be defined very generic.
>
> Looking forward to your feedback.
>
> Cheers,
> Timo
>
>
>
>
>
> On 09.06.25 04:01, Leonard Xu wrote:
> > Thanks  Timo for joining this thread.
> >
> > I agree that this feature is needed by the community; the current
> disagreement is only about the implementation method or solution.
> > Your thoughts looks generally good to me, looking forward to your
> proposal.
> >
> > Best,
> > Leonard
> >
> >> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> >>
> >> Hi everyone,
> >>
> >> thanks for this healthy discussion. Looking at high number of
> participants, it looks like we definitely want this feature. We just need
> to figure out the "how".
> >>
> >> This reminds me very much of the discussion we had for CREATE FUNCTION.
> There, we discussed whether functions should be named globally or
> catalog-specific. In the end, we decided for both `CREATE SYSTEM FUNCTION`
> and `CREATE FUNCTION`, satisfying both the data platform team of an
> organization (which might provide system functions) and individual data
> teams or use cases (scoped by catalog/database).
> >>
> >> Looking at other modern vendors like Snowflake there is SECRET (scoped
> to schema) [1] and API INTEGRATION [2] (scoped to account). So also other
> vendors offer global and per-team / per-use case connections details.
> >>
> >> In general, I think fitting connections into the existing concepts for
> catalog objects (with three-part identifier) makes managing them easier.
> But I also see the need for global defaults.
> >>
> >> Btw keep in mind that a catalog implementation should only store
> metadata. Similar how a CatalogTable doesn't store the actual data, a
> CatalogConnection should not store the credentials. It should only offer a
> factory that allows for storing and retrieving them. In real world
> scenarios a factory is most likely backed by a product like Azure Key Vault.
> >>
> >> So code-wise having a ConnectionManager that behaves similar to
> FunctionManager sounds reasonable.
> >>
> >> +1 for having special syntax instead of using properties. This allows
> to access connections in tables, models, functions. And catalogs, if we
> agree to have global ones as well.
> >>
> >> What do you think?
> >>
> >> Let me spend some more thoughts on this and come back with a concrete
> proposal by early next week.
> >>
> >> Cheers,
> >> Timo
> >>
> >> [1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
> >> [2]
> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> >>
> >> On 04.06.25 10:47, Leonard Xu wrote:
> >>> Hey,Mayank
> >>> Please see my feedback as following:
> >>> 1. One of the motivations of this FLIP is to improve security.
> However, the current design stores all connection information in the
> catalog,
> >>> and each Flink SQL job reads from the catalog during compilation. The
> connection information is passed between SQL Gateway and the
> >>> catalog in plaintext, which actually introduces new security risks.
> >>> 2. The name "Connection" should be changed to something like
> ConnectionSpec to clearly indicate that it is a object containing only
> static
> >>> properties without a lifecycle. Putting aside the naming issue, I
> think the current model and hierarchy design is somewhat strange. Storing
> >>> various kinds of connections (e.g., Kafka, MySQL) in the same Catalog
> with hierarchical identifiers like catalog-name.db-name.connection-name
> >>> raises the following questions:
> >>> (1) What is the purpose of this hierarchical structure of Connection
> object ?
> >>> (2) If we can use a Connection to create a MySQL table, why can't we
> use a Connection to create a MySQL Catalog?
> >>> 3. Regarding the connector usage examples given in this FLIP:
> >>> ```sql
> >>> 1  -- Example 2: Using connection for jdbc tables
> >>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> >>> 3  WITH (
> >>> 4    'type' = 'jdbc',
> >>> 5    'jdbc.url' = 'jdbc:mysql://
> customer-db.example.com:3306/customerdb',
> >>> 6    'jdbc.connection.ssl.enabled' = 'true'
> >>> 7  );
> >>> 8
> >>> 9  CREATE TABLE customers (
> >>> 10   customer_id INT,
> >>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> >>> 12 ) WITH (
> >>> 13   'connector' = 'jdbc',
> >>> 14   'jdbc.connection' = 'mysql_customer_db',
> >>> 15   'jdbc.connection.ssl.enabled' = 'true',
> >>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> >>> 17   'jdbc.table-name' = 'customers',
> >>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> >>> 19 );
> >>> ```
> >>> I see three issues from SQL semantics and Connector compatibility
> perspectives:
> >>> (1) Look at line 14: `mysql_customer_db` is an object identifier of a
> CONNECTION defined in SQL. However, this identifier is referenced
> >>>      via a string value inside the table’s WITH clause, which feel
> hack for me.
> >>> (2) Look at lines 14–16: the use of the specific prefix
> `jdbc.connection` will confuse users because `connection.xx` maybe already
> used as
> >>>   a prefix for existing configuration items.
> >>> (3) Look at lines 14–18: Why do all existing configuration options
> need to be prefixed with `jdbc`, even they’re not related to Connection
> properties?
> >>> This completely changes user habits — is it backward compatible?
> >>>   In my opinion, Connection should be a model independent of both
> Catalog and Table, and can be referenced by all catalog/table/udf/model
> object.
> >>> It should be managed by a Component such as a ConnectionManager to
> enable reuse. For security purposes, authentication mechanisms could
> >>> be supported within the ConnectionManager.
> >>> Best,
> >>> Leonard
> >>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> >>>>
> >>>> Hi all,
> >>>>
> >>>> First of all, I think having a Connection resource is something that
> will
> >>>> be beneficial for Apache Flink. I could see that being extended in the
> >>>> future to allow for easier secret handling [1].
> >>>> In my mental mind, I'm comparing this proposal against SQL/MED from
> the ISO
> >>>> standard [2]. I do think that SQL/MED isn't a very user friendly
> syntax
> >>>> though, looking at Postgres for example [3].
> >>>>
> >>>> I think it's a valid question if Connection should be considered with
> a
> >>>> catalog or database-level scope. @Ryan can you share something more,
> since
> >>>> you've mentioned "Note: I much prefer catalogs for this case. Which
> is what
> >>>> we use internally to manage connection properties". It looks like
> there
> >>>> isn't a strong favourable approach looking at other vendors (like,
> >>>> Databricks does scopes it on a Unity catalog, Snowflake on a database
> >>>> level).
> >>>>
> >>>> Also looking forward to Leonard's input.
> >>>>
> >>>> Best regards,
> >>>>
> >>>> Martijn
> >>>>
> >>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> >>>> [2] https://www.iso.org/standard/84804.html
> >>>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
> >>>>
> >>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
> >>>>
> >>>>> Hey Mayank.
> >>>>>
> >>>>> Thanks for the FLIP, I went through this FLIP quickly and found some
> >>>>> issues which I think we
> >>>>> need to deep discuss later. As we’re on a short Dragon boat Festival,
> >>>>> could you kindly hold
> >>>>> on this thread? and we will back to continue the FLIP discuss.
> >>>>>
> >>>>> Best,
> >>>>> Leonard
> >>>>>
> >>>>>
> >>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> >>>>>>
> >>>>>> Hi all,
> >>>>>>
> >>>>>> I would like to open up for discussion a new FLIP-529 [1].
> >>>>>>
> >>>>>> Motivation:
> >>>>>> Currently, Flink SQL handles external connectivity by defining
> endpoints
> >>>>>> and credentials in table configuration. This approach prevents
> >>>>> reusability
> >>>>>> of these connections and makes table definition less secure by
> exposing
> >>>>>> sensitive information.
> >>>>>> We propose the introduction of a new "connection" resource in
> Flink. This
> >>>>>> will be a pluggable resource configured with a remote endpoint and
> >>>>>> associated access key. Once defined, connections can be reused
> across
> >>>>> table
> >>>>>> definitions, and eventually for model definition (as discussed in
> >>>>> FLIP-437)
> >>>>>> for inference, enabling seamless and secure integration with
> external
> >>>>>> systems.
> >>>>>> The connection resource will provide a new, optional way to manage
> >>>>> external
> >>>>>> connectivity in Flink. Existing methods for table definitions will
> remain
> >>>>>> unchanged.
> >>>>>>
> >>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>
> >>>>>> Best Regards,
> >>>>>> Mayank Juneja
> >>>>>
> >>>>>
> >>
> >
>
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hao Li <hl...@confluent.io.INVALID>.
Hi Yanquan,

Thanks for the feedback.

> (1) I agree with the design of SecretStore. I hope to add the results of
the 'SHOW Connections' query to the document, 'secret.id' should be
included in the results, This helps us establish the association between
tables and connections.

I think we can output "secret.id" field in `describe connection` query.
`show connections` can show the names of connections similar to other show
command such as `show tables` or `show models`?

> Can you clearly point out this point. It seems that we cannot create a
CatalogConnection under any catalog. For example, we cannot save
CatalogConnection in the JDBC catalog.

I didn't mean we can't create connection under catalog. I meant we can't
create catalog using connection if connection exists in catalog. We need to
introduce some System Connection later to be used to create catalog. If you
already have a JDBC catalog, we can still save CatalogConnection in it.

Thanks,
Hao

On Sun, Jul 27, 2025 at 7:24 PM Yanquan Lv <de...@gmail.com> wrote:

> Hi Mayank and Hao,
> Thanks for the updates and comments. Here are some of my opinions:
>
> (1) I agree with the design of SecretStore. I hope to add the results of
> the 'SHOW Connections' query to the document, 'secret.id' should be
> included in the results, This helps us establish the association between
> tables and connections.
> (2)
> > I think for connections to be used for catalog
> > creation, it needs to be system connection similar to system function
> which
> > exist outside of CatalogManager.
> Can you clearly point out this point. It seems that we cannot create a
> CatalogConnection under any catalog. For example, we cannot save
> CatalogConnection in the JDBC catalog.
>
> Hao Li <hl...@confluent.io.invalid> 于2025年7月25日周五 06:54写道:
>
> > Hi Shengkai, Leonard,
> >
> > Thanks for the feedback.
> >
> > For Shengkai's feedback:
> >
> > > 1. Why SecretStoreFactory#open throws a CatalogException? I think the
> > exteranl system can not handle this exception.
> > You are right, we can make it throw `Exception`
> >
> > > 2. I think we can also modify the create catalog ddl syntax.
> >
> > ```
> > CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> > WITH (
> >     'type' = 'jdbc'
> > );
> > ```
> >
> > Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
> > chicken-egg problem. I think for connections to be used for catalog
> > creation, it needs to be system connection similar to system function
> which
> > exist outside of CatalogManager. Maybe we can defer this to later
> > functionality?
> >
> > > 3. It seems the connector factory should merge the with options and
> > connection options together and then create the source/sink. It's
> > better that framework can merge all these options and connectors don't
> need
> > any codes.
> >
> > I think it's better to separate connections with table options and make
> it
> > explicit. Reasons is: the connection here should be a decrypted one. It's
> > sensitive and should be handled carefully regarding logging, usage etc.
> > Mixing with original table options makes it hard to do. But the Flip used
> > `CatalogConnection` which is an encrypted one. I'll update it to
> > `SensitveConnection`.
> >
> > > 4. Why we need to introduce ConnectionFactory? I think connection is
> like
> > CatalogTable. It should hold the basic information and all information in
> > the connection should be stored into secret store.
> >
> > The main reason is to enable user defined connection handling for
> different
> > types. For example, if connection type is `basic`, the corresponding
> > factory can handle basic type secrets (e.g. extract username/password
> from
> > connection options and do encryption).
> >
> > For Leonard's feedback:
> > > (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
> > SecretStore?
> >
> > Good catch. Let me update it.
> >
> > >  (2) Configurability of SECRET_FIELDS : Could the hardcoded
> SECRET_FIELDS
> > in BasicConnectionFactory be made configurable (e.g., 'token' vs
> > 'accessKey') for better connector compatibility?
> >
> > This depends on `ConnectionFactory` implementation and can be self
> defined
> > by user.
> >
> > > (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
> > returns SensitiveConnection, while
> BasicConnectionFactory#resolveConnection
> > returns Map<String, String>. Should these be aligned?
> >
> > Good catch. Let me update the FLIP.
> >
> > > (4)Framework-level Resolution : +1 to Shengkai's point about having the
> > framework (DynamicTableFactory) return complete options to reduce
> connector
> > adaptation cost.
> >
> > Please see my explanation for Shengkai's similar question.
> >
> > > (5)Secret ID Handling : When no encryption is needed, secretId is null
> > (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This
> > behavior should be explicitly documented in the interfaces.
> >
> > It's an example in the FLIP about how `ConnectionFactory` could be
> > implemented. How encryption is done depends on actual implementation
> > though. Let me update the example to make it more clear.
> >
> > Thanks,
> > Hao
> >
> > On Thu, Jul 24, 2025 at 5:04 AM Leonard Xu <xb...@gmail.com> wrote:
> >
> > > Hi friends
> > >
> > > I like the updated FLIP goals, that’s what I want. I’ve some feedback:
> > >
> > > (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
> > > SecretStore?
> > > (2) Configurability of SECRET_FIELDS : Could the hardcoded
> SECRET_FIELDS
> > > in BasicConnectionFactory be made configurable (e.g., 'token' vs
> > > 'accessKey') for better connector compatibility?
> > > (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
> > returns
> > > SensitiveConnection, while BasicConnectionFactory#resolveConnection
> > returns
> > > Map<String, String>. Should these be aligned?
> > > (4)Framework-level Resolution : +1 to Shengkai's point about having the
> > > framework (DynamicTableFactory) return complete options to reduce
> > connector
> > > adaptation cost.
> > > (5)Secret ID Handling : When no encryption is needed, secretId is null
> > > (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)).
> This
> > > behavior should be explicitly documented in the interfaces.
> > >
> > > Best,
> > > Leonard
> > >
> > > > 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
> > > >
> > > > hi.
> > > >
> > > > Sorry for the late reply. I just have some questions:
> > > >
> > > > 1. Why SecretStoreFactory#open throws a CatalogException? I think the
> > > > exteranl system can not handle this exception.
> > > >
> > > > 2. I think we can also modify the create catalog ddl syntax.
> > > >
> > > > ```
> > > > CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> > > > WITH (
> > > >    'type' = 'jdbc'
> > > > );
> > > > ```
> > > >
> > > > 3. It seems the connector factory should merge the with options and
> > > > connection options together and then create the source/sink. It's
> > > > better that framework can merge all these options and connectors
> don't
> > > need
> > > > any codes.
> > > >
> > > > 4. Why we need to introduce ConnectionFactory? I think connection is
> > like
> > > > CatalogTable. It should hold the basic information and all
> information
> > in
> > > > the connection should be stored into secret store.
> > > >
> > > >
> > > > Best,
> > > > Shengkai
> > > >
> > > >
> > > > Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
> > > >
> > > >> Hi Mayank,
> > > >>
> > > >> Thanks for updating the FLIP and clearly documenting our discussion.
> > > >>
> > > >> +1 for moving forward with the vote, unless there are objections
> from
> > > >> others.
> > > >>
> > > >> Cheers,
> > > >> Timo
> > > >>
> > > >> On 22.07.25 02:14, Mayank Juneja wrote:
> > > >>> Hi Ryan and Austin,
> > > >>>
> > > >>> Thanks for your suggestions. I've updated the FLIP with the
> following
> > > >>> additional info -
> > > >>>
> > > >>> 1. *table.secret-store.kind* key to register the SecretStore in a
> > yaml
> > > >> file
> > > >>> 2. *updateSecret* method in WritableSecretStore interface
> > > >>>
> > > >>> Thanks,
> > > >>> Mayank
> > > >>>
> > > >>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
> > > >>> austin.cawley@gmail.com> wrote:
> > > >>>
> > > >>>> Hey all,
> > > >>>>
> > > >>>> Thanks for the nice flip all! I’m just reading through – had one
> > > >> question
> > > >>>> on the ALTER CONNECTION implementation flow. Would it make sense
> for
> > > the
> > > >>>> WritableSecretStore to expose a method for updating a secret by
> ID,
> > so
> > > >> it
> > > >>>> can be done atomically? Else, would we need to call delete and
> > create
> > > >>>> again, potentially introducing concurrent resolution errors?
> > > >>>>
> > > >>>> Best,
> > > >>>> Austin
> > > >>>>
> > > >>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
> > > >>>> <ry...@shopify.com.invalid> wrote:
> > > >>>>
> > > >>>>> Hi Mayank,
> > > >>>>>
> > > >>>>> Thanks for updating the FLIP. Overall it looks good to me.
> > > >>>>>
> > > >>>>> One question I had related to how someone could choose the
> > > SecretStore
> > > >>>> they
> > > >>>>> want to use if they use something like the SQL Gateway as the
> > > >> entrypoint
> > > >>>> on
> > > >>>>> top of a remote Session cluster. I don't see an explicit way to
> set
> > > the
> > > >>>>> SecretStore in the FLIP.
> > > >>>>> I assume we'll do it similar to the CatalogStore but I wanted to
> > call
> > > >>>> this
> > > >>>>> out.
> > > >>>>>
> > > >>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
> > > >>>>> file:///path/to/catalog/store/
> > > >>>>>
> > > >>>>> Ryan van Huuksloot
> > > >>>>> Staff Engineer, Infrastructure | Streaming Platform
> > > >>>>> [image: Shopify]
> > > >>>>> <
> > > >>
> > https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
> > > >> mayankjuneja27@gmail.com>
> > > >>>>> wrote:
> > > >>>>>
> > > >>>>>> Hi everyone,
> > > >>>>>>
> > > >>>>>> Thanks for your valuable inputs. I have updated the FLIP with
> the
> > > >> ideas
> > > >>>>>> proposed earlier in the thread. Looking forward to your
> feedback.
> > > >>>>>> https://cwiki.apache.org/confluence/x/cYroF
> > > >>>>>>
> > > >>>>>> Best,
> > > >>>>>> Mayank
> > > >>>>>>
> > > >>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
> > > wrote:
> > > >>>>>>
> > > >>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.
> The
> > > new
> > > >>>>>>> proposal looks well, +1 from my side.
> > > >>>>>>>
> > > >>>>>>> Could you draft(update) current FLIP docs thus we can have some
> > > >>>>> specific
> > > >>>>>>> discussions later?
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>>> Best,
> > > >>>>>>> Leonard
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> > > >>>>>>>>
> > > >>>>>>>> Hi everyone,
> > > >>>>>>>>
> > > >>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank,
> > Hao
> > > >>>>> and
> > > >>>>>> I
> > > >>>>>>> synced offline and came up we an improved proposal. Before we
> > > update
> > > >>>>> the
> > > >>>>>>> FLIP let me summarize the most important key facts that
> hopefully
> > > >>>>> address
> > > >>>>>>> most concerns:
> > > >>>>>>>>
> > > >>>>>>>> 1) SecretStore
> > > >>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
> > > >>>> highest
> > > >>>>>>> level in TableEnvironment.
> > > >>>>>>>> - SecretStore is initialized with options and potentially
> > > >>>> environment
> > > >>>>>>> variables. Including
> > > >>>> EnvironmentSettings.withSecretStore(SecretStore).
> > > >>>>>>>> - The SecretStore is pluggable and discovered using the
> regular
> > > >>>>>>> factory-approach.
> > > >>>>>>>> - For example, it could implement Azure Key Vault or other
> cloud
> > > >>>>>>> provider secrets stores.
> > > >>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
> > > sensitive
> > > >>>>>> data.
> > > >>>>>>>>
> > > >>>>>>>> 2) Connections
> > > >>>>>>>> - Connections are catalog objects identified with 3-part
> > > >>>> identifiers.
> > > >>>>>>> 3-part identifiers are crucial for managability of larger
> > projects
> > > >>>> and
> > > >>>>>>> align with existing catalog objects.
> > > >>>>>>>> - They contain connection details, e.g. URL, query parameters,
> > and
> > > >>>>>> other
> > > >>>>>>> configuration.
> > > >>>>>>>> - They do not contain secrets, but only pointers to secrets in
> > the
> > > >>>>>>> SecretStore.
> > > >>>>>>>>
> > > >>>>>>>> 3) Connection DDL
> > > >>>>>>>>
> > > >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > >>>>>>>>  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> > > >>>>>>>>  ...
> > > >>>>>>>> )
> > > >>>>>>>>
> > > >>>>>>>> - Connection type is pluggable and discovered using the
> regular
> > > >>>>>>> factory-approach.
> > > >>>>>>>> - The factory extracts secrets and puts them into SecretStore.
> > > >>>>>>>> - The factory only leaves non-confidential options left that
> can
> > > be
> > > >>>>>>> stored in a catalog.
> > > >>>>>>>>
> > > >>>>>>>> When executing:
> > > >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > >>>>>>>>  'type' = 'basic',
> > > >>>>>>>>  'url' = 'api.example.com',
> > > >>>>>>>>  'username' = 'bob',
> > > >>>>>>>>  'password' = 'xyz'
> > > >>>>>>>> )
> > > >>>>>>>>
> > > >>>>>>>> The catalog will receive something similar to:
> > > >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > >>>>>>>>  'type' = 'basic',
> > > >>>>>>>>  'url' = 'api.example.com',
> > > >>>>>>>>  'secret.store' = 'azure-key-vault'
> > > >>>>>>>>  'secret.id' = 'secretId'
> > > >>>>>>>> )
> > > >>>>>>>>
> > > >>>>>>>> - However, the exact property design is up to the connection
> > > >>>> factory.
> > > >>>>>>>>
> > > >>>>>>>> 4) Connection Usage
> > > >>>>>>>>
> > > >>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> > > >>>>>>>>
> > > >>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION
> > keyword
> > > >>>>>>> similar to BigQuery.
> > > >>>>>>>> - The connection will be provided in a table/model
> > > >>>> provider/function
> > > >>>>>>> definition factory.
> > > >>>>>>>>
> > > >>>>>>>> 5) CatalogStore / Catalog Initialization
> > > >>>>>>>>
> > > >>>>>>>> Catalog store or catalog can make use of SecretStore to
> retrieve
> > > >>>>>> initial
> > > >>>>>>> credentials for bootstrapping. All objects lower then catalog
> > > >>>>>> store/catalog
> > > >>>>>>> can then use connections. If you think we still need system
> level
> > > >>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
> > > WITH
> > > >>>>> (..)
> > > >>>>>>> similar to SYSTEM functions directly store in a
> ConnectioManager
> > in
> > > >>>>>>> TableEnvironment. But for now I would suggest to start simple
> > with
> > > >>>>>>> per-catalog connections and later evolve the design.
> > > >>>>>>>>
> > > >>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly
> > not
> > > >>>> an
> > > >>>>>>> expert on it. This is why we should try to push the problem to
> > > >>>> existing
> > > >>>>>>> solutions and don't start storing secrets in Flink in any way.
> > > Thus,
> > > >>>>> the
> > > >>>>>>> interfaces will be defined very generic.
> > > >>>>>>>>
> > > >>>>>>>> Looking forward to your feedback.
> > > >>>>>>>>
> > > >>>>>>>> Cheers,
> > > >>>>>>>> Timo
> > > >>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
> > > >>>>>>>>> Thanks  Timo for joining this thread.
> > > >>>>>>>>> I agree that this feature is needed by the community; the
> > current
> > > >>>>>>> disagreement is only about the implementation method or
> solution.
> > > >>>>>>>>> Your thoughts looks generally good to me, looking forward to
> > your
> > > >>>>>>> proposal.
> > > >>>>>>>>> Best,
> > > >>>>>>>>> Leonard
> > > >>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> > > >>>>>>>>>>
> > > >>>>>>>>>> Hi everyone,
> > > >>>>>>>>>>
> > > >>>>>>>>>> thanks for this healthy discussion. Looking at high number
> of
> > > >>>>>>> participants, it looks like we definitely want this feature. We
> > > just
> > > >>>>> need
> > > >>>>>>> to figure out the "how".
> > > >>>>>>>>>>
> > > >>>>>>>>>> This reminds me very much of the discussion we had for
> CREATE
> > > >>>>>>> FUNCTION. There, we discussed whether functions should be named
> > > >>>>> globally
> > > >>>>>> or
> > > >>>>>>> catalog-specific. In the end, we decided for both `CREATE
> SYSTEM
> > > >>>>>> FUNCTION`
> > > >>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team
> of
> > an
> > > >>>>>>> organization (which might provide system functions) and
> > individual
> > > >>>> data
> > > >>>>>>> teams or use cases (scoped by catalog/database).
> > > >>>>>>>>>>
> > > >>>>>>>>>> Looking at other modern vendors like Snowflake there is
> SECRET
> > > >>>>>> (scoped
> > > >>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So
> > also
> > > >>>>> other
> > > >>>>>>> vendors offer global and per-team / per-use case connections
> > > details.
> > > >>>>>>>>>>
> > > >>>>>>>>>> In general, I think fitting connections into the existing
> > > >>>> concepts
> > > >>>>>> for
> > > >>>>>>> catalog objects (with three-part identifier) makes managing
> them
> > > >>>>> easier.
> > > >>>>>>> But I also see the need for global defaults.
> > > >>>>>>>>>>
> > > >>>>>>>>>> Btw keep in mind that a catalog implementation should only
> > store
> > > >>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
> > > data, a
> > > >>>>>>> CatalogConnection should not store the credentials. It should
> > only
> > > >>>>> offer
> > > >>>>>> a
> > > >>>>>>> factory that allows for storing and retrieving them. In real
> > world
> > > >>>>>>> scenarios a factory is most likely backed by a product like
> Azure
> > > Key
> > > >>>>>> Vault.
> > > >>>>>>>>>>
> > > >>>>>>>>>> So code-wise having a ConnectionManager that behaves similar
> > to
> > > >>>>>>> FunctionManager sounds reasonable.
> > > >>>>>>>>>>
> > > >>>>>>>>>> +1 for having special syntax instead of using properties.
> This
> > > >>>>> allows
> > > >>>>>>> to access connections in tables, models, functions. And
> catalogs,
> > > if
> > > >>>> we
> > > >>>>>>> agree to have global ones as well.
> > > >>>>>>>>>>
> > > >>>>>>>>>> What do you think?
> > > >>>>>>>>>>
> > > >>>>>>>>>> Let me spend some more thoughts on this and come back with a
> > > >>>>> concrete
> > > >>>>>>> proposal by early next week.
> > > >>>>>>>>>>
> > > >>>>>>>>>> Cheers,
> > > >>>>>>>>>> Timo
> > > >>>>>>>>>>
> > > >>>>>>>>>> [1]
> > > >>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
> > > >>>>>>>>>> [2]
> > > >>>>>>>
> > > >>>>
> > > https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> > > >>>>>>>>>>
> > > >>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
> > > >>>>>>>>>>> Hey,Mayank
> > > >>>>>>>>>>> Please see my feedback as following:
> > > >>>>>>>>>>> 1. One of the motivations of this FLIP is to improve
> > security.
> > > >>>>>>> However, the current design stores all connection information
> in
> > > the
> > > >>>>>>> catalog,
> > > >>>>>>>>>>> and each Flink SQL job reads from the catalog during
> > > >>>> compilation.
> > > >>>>>> The
> > > >>>>>>> connection information is passed between SQL Gateway and the
> > > >>>>>>>>>>> catalog in plaintext, which actually introduces new
> security
> > > >>>>> risks.
> > > >>>>>>>>>>> 2. The name "Connection" should be changed to something
> like
> > > >>>>>>> ConnectionSpec to clearly indicate that it is a object
> containing
> > > >>>> only
> > > >>>>>>> static
> > > >>>>>>>>>>> properties without a lifecycle. Putting aside the naming
> > issue,
> > > >>>> I
> > > >>>>>>> think the current model and hierarchy design is somewhat
> strange.
> > > >>>>> Storing
> > > >>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the
> same
> > > >>>>>> Catalog
> > > >>>>>>> with hierarchical identifiers like
> > > >>>> catalog-name.db-name.connection-name
> > > >>>>>>>>>>> raises the following questions:
> > > >>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
> > > >>>>> Connection
> > > >>>>>>> object ?
> > > >>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
> > > >>>> can't
> > > >>>>> we
> > > >>>>>>> use a Connection to create a MySQL Catalog?
> > > >>>>>>>>>>> 3. Regarding the connector usage examples given in this
> FLIP:
> > > >>>>>>>>>>> ```sql
> > > >>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
> > > >>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> > > >>>>>>>>>>> 3  WITH (
> > > >>>>>>>>>>> 4    'type' = 'jdbc',
> > > >>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
> > > >>>>>>> customer-db.example.com:3306/customerdb',
> > > >>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> > > >>>>>>>>>>> 7  );
> > > >>>>>>>>>>> 8
> > > >>>>>>>>>>> 9  CREATE TABLE customers (
> > > >>>>>>>>>>> 10   customer_id INT,
> > > >>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> > > >>>>>>>>>>> 12 ) WITH (
> > > >>>>>>>>>>> 13   'connector' = 'jdbc',
> > > >>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
> > > >>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> > > >>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> > > >>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
> > > >>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> > > >>>>>>>>>>> 19 );
> > > >>>>>>>>>>> ```
> > > >>>>>>>>>>> I see three issues from SQL semantics and Connector
> > > >>>> compatibility
> > > >>>>>>> perspectives:
> > > >>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
> > > identifier
> > > >>>>> of
> > > >>>>>> a
> > > >>>>>>> CONNECTION defined in SQL. However, this identifier is
> referenced
> > > >>>>>>>>>>>     via a string value inside the table’s WITH clause,
> which
> > > >>>> feel
> > > >>>>>>> hack for me.
> > > >>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
> > > >>>>>>> `jdbc.connection` will confuse users because `connection.xx`
> > maybe
> > > >>>>>> already
> > > >>>>>>> used as
> > > >>>>>>>>>>>  a prefix for existing configuration items.
> > > >>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
> > > >>>> options
> > > >>>>>>> need to be prefixed with `jdbc`, even they’re not related to
> > > >>>> Connection
> > > >>>>>>> properties?
> > > >>>>>>>>>>> This completely changes user habits — is it backward
> > > compatible?
> > > >>>>>>>>>>>  In my opinion, Connection should be a model independent of
> > > both
> > > >>>>>>> Catalog and Table, and can be referenced by all
> > > >>>> catalog/table/udf/model
> > > >>>>>>> object.
> > > >>>>>>>>>>> It should be managed by a Component such as a
> > ConnectionManager
> > > >>>> to
> > > >>>>>>> enable reuse. For security purposes, authentication mechanisms
> > > could
> > > >>>>>>>>>>> be supported within the ConnectionManager.
> > > >>>>>>>>>>> Best,
> > > >>>>>>>>>>> Leonard
> > > >>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org>
> > 写道:
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> Hi all,
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> First of all, I think having a Connection resource is
> > > something
> > > >>>>>> that
> > > >>>>>>> will
> > > >>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
> > > extended
> > > >>>>> in
> > > >>>>>>> the
> > > >>>>>>>>>>>> future to allow for easier secret handling [1].
> > > >>>>>>>>>>>> In my mental mind, I'm comparing this proposal against
> > SQL/MED
> > > >>>>> from
> > > >>>>>>> the ISO
> > > >>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
> > > >>>> friendly
> > > >>>>>>> syntax
> > > >>>>>>>>>>>> though, looking at Postgres for example [3].
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> I think it's a valid question if Connection should be
> > > >>>> considered
> > > >>>>>>> with a
> > > >>>>>>>>>>>> catalog or database-level scope. @Ryan can you share
> > something
> > > >>>>>> more,
> > > >>>>>>> since
> > > >>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this
> > case.
> > > >>>>> Which
> > > >>>>>>> is what
> > > >>>>>>>>>>>> we use internally to manage connection properties". It
> looks
> > > >>>> like
> > > >>>>>>> there
> > > >>>>>>>>>>>> isn't a strong favourable approach looking at other
> vendors
> > > >>>>> (like,
> > > >>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake
> on a
> > > >>>>>> database
> > > >>>>>>>>>>>> level).
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> Also looking forward to Leonard's input.
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> Best regards,
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> Martijn
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> > > >>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
> > > >>>>>>>>>>>> [3]
> > > >>>>> https://www.postgresql.org/docs/current/sql-createserver.html
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <
> > xbjtdcq@gmail.com
> > > >
> > > >>>>>>> wrote:
> > > >>>>>>>>>>>>
> > > >>>>>>>>>>>>> Hey Mayank.
> > > >>>>>>>>>>>>>
> > > >>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
> > > >>>> found
> > > >>>>>> some
> > > >>>>>>>>>>>>> issues which I think we
> > > >>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon
> boat
> > > >>>>>>> Festival,
> > > >>>>>>>>>>>>> could you kindly hold
> > > >>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
> > > discuss.
> > > >>>>>>>>>>>>>
> > > >>>>>>>>>>>>> Best,
> > > >>>>>>>>>>>>> Leonard
> > > >>>>>>>>>>>>>
> > > >>>>>>>>>>>>>
> > > >>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <
> mayankjuneja27@gmail.com>
> > > >>>> 写道:
> > > >>>>>>>>>>>>>>
> > > >>>>>>>>>>>>>> Hi all,
> > > >>>>>>>>>>>>>>
> > > >>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529
> [1].
> > > >>>>>>>>>>>>>>
> > > >>>>>>>>>>>>>> Motivation:
> > > >>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
> > > >>>> defining
> > > >>>>>>> endpoints
> > > >>>>>>>>>>>>>> and credentials in table configuration. This approach
> > > >>>> prevents
> > > >>>>>>>>>>>>> reusability
> > > >>>>>>>>>>>>>> of these connections and makes table definition less
> > secure
> > > >>>> by
> > > >>>>>>> exposing
> > > >>>>>>>>>>>>>> sensitive information.
> > > >>>>>>>>>>>>>> We propose the introduction of a new "connection"
> resource
> > > in
> > > >>>>>>> Flink. This
> > > >>>>>>>>>>>>>> will be a pluggable resource configured with a remote
> > > >>>> endpoint
> > > >>>>>> and
> > > >>>>>>>>>>>>>> associated access key. Once defined, connections can be
> > > >>>> reused
> > > >>>>>>> across
> > > >>>>>>>>>>>>> table
> > > >>>>>>>>>>>>>> definitions, and eventually for model definition (as
> > > >>>> discussed
> > > >>>>> in
> > > >>>>>>>>>>>>> FLIP-437)
> > > >>>>>>>>>>>>>> for inference, enabling seamless and secure integration
> > with
> > > >>>>>>> external
> > > >>>>>>>>>>>>>> systems.
> > > >>>>>>>>>>>>>> The connection resource will provide a new, optional way
> > to
> > > >>>>>> manage
> > > >>>>>>>>>>>>> external
> > > >>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
> > > definitions
> > > >>>>>> will
> > > >>>>>>> remain
> > > >>>>>>>>>>>>>> unchanged.
> > > >>>>>>>>>>>>>>
> > > >>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> > > >>>>>>>>>>>>>>
> > > >>>>>>>>>>>>>> Best Regards,
> > > >>>>>>>>>>>>>> Mayank Juneja
> > > >>>>>>>>>>>>>
> > > >>>>>>>>>>>>>
> > > >>>>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>>
> > > >>>>>> --
> > > >>>>>> *Mayank Juneja*
> > > >>>>>> Product Manager | Data Streaming and AI
> > > >>>>>>
> > > >>>>>
> > > >>>>
> > > >>>
> > > >>>
> > > >>
> > > >>
> > >
> > >
> >
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Yanquan Lv <de...@gmail.com>.
Hi Mayank and Hao,
Thanks for the updates and comments. Here are some of my opinions:

(1) I agree with the design of SecretStore. I hope to add the results of
the 'SHOW Connections' query to the document, 'secret.id' should be
included in the results, This helps us establish the association between
tables and connections.
(2)
> I think for connections to be used for catalog
> creation, it needs to be system connection similar to system function
which
> exist outside of CatalogManager.
Can you clearly point out this point. It seems that we cannot create a
CatalogConnection under any catalog. For example, we cannot save
CatalogConnection in the JDBC catalog.

Hao Li <hl...@confluent.io.invalid> 于2025年7月25日周五 06:54写道:

> Hi Shengkai, Leonard,
>
> Thanks for the feedback.
>
> For Shengkai's feedback:
>
> > 1. Why SecretStoreFactory#open throws a CatalogException? I think the
> exteranl system can not handle this exception.
> You are right, we can make it throw `Exception`
>
> > 2. I think we can also modify the create catalog ddl syntax.
>
> ```
> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> WITH (
>     'type' = 'jdbc'
> );
> ```
>
> Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
> chicken-egg problem. I think for connections to be used for catalog
> creation, it needs to be system connection similar to system function which
> exist outside of CatalogManager. Maybe we can defer this to later
> functionality?
>
> > 3. It seems the connector factory should merge the with options and
> connection options together and then create the source/sink. It's
> better that framework can merge all these options and connectors don't need
> any codes.
>
> I think it's better to separate connections with table options and make it
> explicit. Reasons is: the connection here should be a decrypted one. It's
> sensitive and should be handled carefully regarding logging, usage etc.
> Mixing with original table options makes it hard to do. But the Flip used
> `CatalogConnection` which is an encrypted one. I'll update it to
> `SensitveConnection`.
>
> > 4. Why we need to introduce ConnectionFactory? I think connection is like
> CatalogTable. It should hold the basic information and all information in
> the connection should be stored into secret store.
>
> The main reason is to enable user defined connection handling for different
> types. For example, if connection type is `basic`, the corresponding
> factory can handle basic type secrets (e.g. extract username/password from
> connection options and do encryption).
>
> For Leonard's feedback:
> > (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
> SecretStore?
>
> Good catch. Let me update it.
>
> >  (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
> in BasicConnectionFactory be made configurable (e.g., 'token' vs
> 'accessKey') for better connector compatibility?
>
> This depends on `ConnectionFactory` implementation and can be self defined
> by user.
>
> > (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
> returns SensitiveConnection, while BasicConnectionFactory#resolveConnection
> returns Map<String, String>. Should these be aligned?
>
> Good catch. Let me update the FLIP.
>
> > (4)Framework-level Resolution : +1 to Shengkai's point about having the
> framework (DynamicTableFactory) return complete options to reduce connector
> adaptation cost.
>
> Please see my explanation for Shengkai's similar question.
>
> > (5)Secret ID Handling : When no encryption is needed, secretId is null
> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This
> behavior should be explicitly documented in the interfaces.
>
> It's an example in the FLIP about how `ConnectionFactory` could be
> implemented. How encryption is done depends on actual implementation
> though. Let me update the example to make it more clear.
>
> Thanks,
> Hao
>
> On Thu, Jul 24, 2025 at 5:04 AM Leonard Xu <xb...@gmail.com> wrote:
>
> > Hi friends
> >
> > I like the updated FLIP goals, that’s what I want. I’ve some feedback:
> >
> > (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
> > SecretStore?
> > (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
> > in BasicConnectionFactory be made configurable (e.g., 'token' vs
> > 'accessKey') for better connector compatibility?
> > (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
> returns
> > SensitiveConnection, while BasicConnectionFactory#resolveConnection
> returns
> > Map<String, String>. Should these be aligned?
> > (4)Framework-level Resolution : +1 to Shengkai's point about having the
> > framework (DynamicTableFactory) return complete options to reduce
> connector
> > adaptation cost.
> > (5)Secret ID Handling : When no encryption is needed, secretId is null
> > (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This
> > behavior should be explicitly documented in the interfaces.
> >
> > Best,
> > Leonard
> >
> > > 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
> > >
> > > hi.
> > >
> > > Sorry for the late reply. I just have some questions:
> > >
> > > 1. Why SecretStoreFactory#open throws a CatalogException? I think the
> > > exteranl system can not handle this exception.
> > >
> > > 2. I think we can also modify the create catalog ddl syntax.
> > >
> > > ```
> > > CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> > > WITH (
> > >    'type' = 'jdbc'
> > > );
> > > ```
> > >
> > > 3. It seems the connector factory should merge the with options and
> > > connection options together and then create the source/sink. It's
> > > better that framework can merge all these options and connectors don't
> > need
> > > any codes.
> > >
> > > 4. Why we need to introduce ConnectionFactory? I think connection is
> like
> > > CatalogTable. It should hold the basic information and all information
> in
> > > the connection should be stored into secret store.
> > >
> > >
> > > Best,
> > > Shengkai
> > >
> > >
> > > Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
> > >
> > >> Hi Mayank,
> > >>
> > >> Thanks for updating the FLIP and clearly documenting our discussion.
> > >>
> > >> +1 for moving forward with the vote, unless there are objections from
> > >> others.
> > >>
> > >> Cheers,
> > >> Timo
> > >>
> > >> On 22.07.25 02:14, Mayank Juneja wrote:
> > >>> Hi Ryan and Austin,
> > >>>
> > >>> Thanks for your suggestions. I've updated the FLIP with the following
> > >>> additional info -
> > >>>
> > >>> 1. *table.secret-store.kind* key to register the SecretStore in a
> yaml
> > >> file
> > >>> 2. *updateSecret* method in WritableSecretStore interface
> > >>>
> > >>> Thanks,
> > >>> Mayank
> > >>>
> > >>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
> > >>> austin.cawley@gmail.com> wrote:
> > >>>
> > >>>> Hey all,
> > >>>>
> > >>>> Thanks for the nice flip all! I’m just reading through – had one
> > >> question
> > >>>> on the ALTER CONNECTION implementation flow. Would it make sense for
> > the
> > >>>> WritableSecretStore to expose a method for updating a secret by ID,
> so
> > >> it
> > >>>> can be done atomically? Else, would we need to call delete and
> create
> > >>>> again, potentially introducing concurrent resolution errors?
> > >>>>
> > >>>> Best,
> > >>>> Austin
> > >>>>
> > >>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
> > >>>> <ry...@shopify.com.invalid> wrote:
> > >>>>
> > >>>>> Hi Mayank,
> > >>>>>
> > >>>>> Thanks for updating the FLIP. Overall it looks good to me.
> > >>>>>
> > >>>>> One question I had related to how someone could choose the
> > SecretStore
> > >>>> they
> > >>>>> want to use if they use something like the SQL Gateway as the
> > >> entrypoint
> > >>>> on
> > >>>>> top of a remote Session cluster. I don't see an explicit way to set
> > the
> > >>>>> SecretStore in the FLIP.
> > >>>>> I assume we'll do it similar to the CatalogStore but I wanted to
> call
> > >>>> this
> > >>>>> out.
> > >>>>>
> > >>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
> > >>>>> file:///path/to/catalog/store/
> > >>>>>
> > >>>>> Ryan van Huuksloot
> > >>>>> Staff Engineer, Infrastructure | Streaming Platform
> > >>>>> [image: Shopify]
> > >>>>> <
> > >>
> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
> > >> mayankjuneja27@gmail.com>
> > >>>>> wrote:
> > >>>>>
> > >>>>>> Hi everyone,
> > >>>>>>
> > >>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
> > >> ideas
> > >>>>>> proposed earlier in the thread. Looking forward to your feedback.
> > >>>>>> https://cwiki.apache.org/confluence/x/cYroF
> > >>>>>>
> > >>>>>> Best,
> > >>>>>> Mayank
> > >>>>>>
> > >>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
> > wrote:
> > >>>>>>
> > >>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The
> > new
> > >>>>>>> proposal looks well, +1 from my side.
> > >>>>>>>
> > >>>>>>> Could you draft(update) current FLIP docs thus we can have some
> > >>>>> specific
> > >>>>>>> discussions later?
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> Best,
> > >>>>>>> Leonard
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> > >>>>>>>>
> > >>>>>>>> Hi everyone,
> > >>>>>>>>
> > >>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank,
> Hao
> > >>>>> and
> > >>>>>> I
> > >>>>>>> synced offline and came up we an improved proposal. Before we
> > update
> > >>>>> the
> > >>>>>>> FLIP let me summarize the most important key facts that hopefully
> > >>>>> address
> > >>>>>>> most concerns:
> > >>>>>>>>
> > >>>>>>>> 1) SecretStore
> > >>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
> > >>>> highest
> > >>>>>>> level in TableEnvironment.
> > >>>>>>>> - SecretStore is initialized with options and potentially
> > >>>> environment
> > >>>>>>> variables. Including
> > >>>> EnvironmentSettings.withSecretStore(SecretStore).
> > >>>>>>>> - The SecretStore is pluggable and discovered using the regular
> > >>>>>>> factory-approach.
> > >>>>>>>> - For example, it could implement Azure Key Vault or other cloud
> > >>>>>>> provider secrets stores.
> > >>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
> > sensitive
> > >>>>>> data.
> > >>>>>>>>
> > >>>>>>>> 2) Connections
> > >>>>>>>> - Connections are catalog objects identified with 3-part
> > >>>> identifiers.
> > >>>>>>> 3-part identifiers are crucial for managability of larger
> projects
> > >>>> and
> > >>>>>>> align with existing catalog objects.
> > >>>>>>>> - They contain connection details, e.g. URL, query parameters,
> and
> > >>>>>> other
> > >>>>>>> configuration.
> > >>>>>>>> - They do not contain secrets, but only pointers to secrets in
> the
> > >>>>>>> SecretStore.
> > >>>>>>>>
> > >>>>>>>> 3) Connection DDL
> > >>>>>>>>
> > >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > >>>>>>>>  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> > >>>>>>>>  ...
> > >>>>>>>> )
> > >>>>>>>>
> > >>>>>>>> - Connection type is pluggable and discovered using the regular
> > >>>>>>> factory-approach.
> > >>>>>>>> - The factory extracts secrets and puts them into SecretStore.
> > >>>>>>>> - The factory only leaves non-confidential options left that can
> > be
> > >>>>>>> stored in a catalog.
> > >>>>>>>>
> > >>>>>>>> When executing:
> > >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > >>>>>>>>  'type' = 'basic',
> > >>>>>>>>  'url' = 'api.example.com',
> > >>>>>>>>  'username' = 'bob',
> > >>>>>>>>  'password' = 'xyz'
> > >>>>>>>> )
> > >>>>>>>>
> > >>>>>>>> The catalog will receive something similar to:
> > >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > >>>>>>>>  'type' = 'basic',
> > >>>>>>>>  'url' = 'api.example.com',
> > >>>>>>>>  'secret.store' = 'azure-key-vault'
> > >>>>>>>>  'secret.id' = 'secretId'
> > >>>>>>>> )
> > >>>>>>>>
> > >>>>>>>> - However, the exact property design is up to the connection
> > >>>> factory.
> > >>>>>>>>
> > >>>>>>>> 4) Connection Usage
> > >>>>>>>>
> > >>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> > >>>>>>>>
> > >>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION
> keyword
> > >>>>>>> similar to BigQuery.
> > >>>>>>>> - The connection will be provided in a table/model
> > >>>> provider/function
> > >>>>>>> definition factory.
> > >>>>>>>>
> > >>>>>>>> 5) CatalogStore / Catalog Initialization
> > >>>>>>>>
> > >>>>>>>> Catalog store or catalog can make use of SecretStore to retrieve
> > >>>>>> initial
> > >>>>>>> credentials for bootstrapping. All objects lower then catalog
> > >>>>>> store/catalog
> > >>>>>>> can then use connections. If you think we still need system level
> > >>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
> > WITH
> > >>>>> (..)
> > >>>>>>> similar to SYSTEM functions directly store in a ConnectioManager
> in
> > >>>>>>> TableEnvironment. But for now I would suggest to start simple
> with
> > >>>>>>> per-catalog connections and later evolve the design.
> > >>>>>>>>
> > >>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly
> not
> > >>>> an
> > >>>>>>> expert on it. This is why we should try to push the problem to
> > >>>> existing
> > >>>>>>> solutions and don't start storing secrets in Flink in any way.
> > Thus,
> > >>>>> the
> > >>>>>>> interfaces will be defined very generic.
> > >>>>>>>>
> > >>>>>>>> Looking forward to your feedback.
> > >>>>>>>>
> > >>>>>>>> Cheers,
> > >>>>>>>> Timo
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
> > >>>>>>>>> Thanks  Timo for joining this thread.
> > >>>>>>>>> I agree that this feature is needed by the community; the
> current
> > >>>>>>> disagreement is only about the implementation method or solution.
> > >>>>>>>>> Your thoughts looks generally good to me, looking forward to
> your
> > >>>>>>> proposal.
> > >>>>>>>>> Best,
> > >>>>>>>>> Leonard
> > >>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> > >>>>>>>>>>
> > >>>>>>>>>> Hi everyone,
> > >>>>>>>>>>
> > >>>>>>>>>> thanks for this healthy discussion. Looking at high number of
> > >>>>>>> participants, it looks like we definitely want this feature. We
> > just
> > >>>>> need
> > >>>>>>> to figure out the "how".
> > >>>>>>>>>>
> > >>>>>>>>>> This reminds me very much of the discussion we had for CREATE
> > >>>>>>> FUNCTION. There, we discussed whether functions should be named
> > >>>>> globally
> > >>>>>> or
> > >>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
> > >>>>>> FUNCTION`
> > >>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team of
> an
> > >>>>>>> organization (which might provide system functions) and
> individual
> > >>>> data
> > >>>>>>> teams or use cases (scoped by catalog/database).
> > >>>>>>>>>>
> > >>>>>>>>>> Looking at other modern vendors like Snowflake there is SECRET
> > >>>>>> (scoped
> > >>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So
> also
> > >>>>> other
> > >>>>>>> vendors offer global and per-team / per-use case connections
> > details.
> > >>>>>>>>>>
> > >>>>>>>>>> In general, I think fitting connections into the existing
> > >>>> concepts
> > >>>>>> for
> > >>>>>>> catalog objects (with three-part identifier) makes managing them
> > >>>>> easier.
> > >>>>>>> But I also see the need for global defaults.
> > >>>>>>>>>>
> > >>>>>>>>>> Btw keep in mind that a catalog implementation should only
> store
> > >>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
> > data, a
> > >>>>>>> CatalogConnection should not store the credentials. It should
> only
> > >>>>> offer
> > >>>>>> a
> > >>>>>>> factory that allows for storing and retrieving them. In real
> world
> > >>>>>>> scenarios a factory is most likely backed by a product like Azure
> > Key
> > >>>>>> Vault.
> > >>>>>>>>>>
> > >>>>>>>>>> So code-wise having a ConnectionManager that behaves similar
> to
> > >>>>>>> FunctionManager sounds reasonable.
> > >>>>>>>>>>
> > >>>>>>>>>> +1 for having special syntax instead of using properties. This
> > >>>>> allows
> > >>>>>>> to access connections in tables, models, functions. And catalogs,
> > if
> > >>>> we
> > >>>>>>> agree to have global ones as well.
> > >>>>>>>>>>
> > >>>>>>>>>> What do you think?
> > >>>>>>>>>>
> > >>>>>>>>>> Let me spend some more thoughts on this and come back with a
> > >>>>> concrete
> > >>>>>>> proposal by early next week.
> > >>>>>>>>>>
> > >>>>>>>>>> Cheers,
> > >>>>>>>>>> Timo
> > >>>>>>>>>>
> > >>>>>>>>>> [1]
> > >>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
> > >>>>>>>>>> [2]
> > >>>>>>>
> > >>>>
> > https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> > >>>>>>>>>>
> > >>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
> > >>>>>>>>>>> Hey,Mayank
> > >>>>>>>>>>> Please see my feedback as following:
> > >>>>>>>>>>> 1. One of the motivations of this FLIP is to improve
> security.
> > >>>>>>> However, the current design stores all connection information in
> > the
> > >>>>>>> catalog,
> > >>>>>>>>>>> and each Flink SQL job reads from the catalog during
> > >>>> compilation.
> > >>>>>> The
> > >>>>>>> connection information is passed between SQL Gateway and the
> > >>>>>>>>>>> catalog in plaintext, which actually introduces new security
> > >>>>> risks.
> > >>>>>>>>>>> 2. The name "Connection" should be changed to something like
> > >>>>>>> ConnectionSpec to clearly indicate that it is a object containing
> > >>>> only
> > >>>>>>> static
> > >>>>>>>>>>> properties without a lifecycle. Putting aside the naming
> issue,
> > >>>> I
> > >>>>>>> think the current model and hierarchy design is somewhat strange.
> > >>>>> Storing
> > >>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the same
> > >>>>>> Catalog
> > >>>>>>> with hierarchical identifiers like
> > >>>> catalog-name.db-name.connection-name
> > >>>>>>>>>>> raises the following questions:
> > >>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
> > >>>>> Connection
> > >>>>>>> object ?
> > >>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
> > >>>> can't
> > >>>>> we
> > >>>>>>> use a Connection to create a MySQL Catalog?
> > >>>>>>>>>>> 3. Regarding the connector usage examples given in this FLIP:
> > >>>>>>>>>>> ```sql
> > >>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
> > >>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> > >>>>>>>>>>> 3  WITH (
> > >>>>>>>>>>> 4    'type' = 'jdbc',
> > >>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
> > >>>>>>> customer-db.example.com:3306/customerdb',
> > >>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> > >>>>>>>>>>> 7  );
> > >>>>>>>>>>> 8
> > >>>>>>>>>>> 9  CREATE TABLE customers (
> > >>>>>>>>>>> 10   customer_id INT,
> > >>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> > >>>>>>>>>>> 12 ) WITH (
> > >>>>>>>>>>> 13   'connector' = 'jdbc',
> > >>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
> > >>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> > >>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> > >>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
> > >>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> > >>>>>>>>>>> 19 );
> > >>>>>>>>>>> ```
> > >>>>>>>>>>> I see three issues from SQL semantics and Connector
> > >>>> compatibility
> > >>>>>>> perspectives:
> > >>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
> > identifier
> > >>>>> of
> > >>>>>> a
> > >>>>>>> CONNECTION defined in SQL. However, this identifier is referenced
> > >>>>>>>>>>>     via a string value inside the table’s WITH clause, which
> > >>>> feel
> > >>>>>>> hack for me.
> > >>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
> > >>>>>>> `jdbc.connection` will confuse users because `connection.xx`
> maybe
> > >>>>>> already
> > >>>>>>> used as
> > >>>>>>>>>>>  a prefix for existing configuration items.
> > >>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
> > >>>> options
> > >>>>>>> need to be prefixed with `jdbc`, even they’re not related to
> > >>>> Connection
> > >>>>>>> properties?
> > >>>>>>>>>>> This completely changes user habits — is it backward
> > compatible?
> > >>>>>>>>>>>  In my opinion, Connection should be a model independent of
> > both
> > >>>>>>> Catalog and Table, and can be referenced by all
> > >>>> catalog/table/udf/model
> > >>>>>>> object.
> > >>>>>>>>>>> It should be managed by a Component such as a
> ConnectionManager
> > >>>> to
> > >>>>>>> enable reuse. For security purposes, authentication mechanisms
> > could
> > >>>>>>>>>>> be supported within the ConnectionManager.
> > >>>>>>>>>>> Best,
> > >>>>>>>>>>> Leonard
> > >>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org>
> 写道:
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> Hi all,
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> First of all, I think having a Connection resource is
> > something
> > >>>>>> that
> > >>>>>>> will
> > >>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
> > extended
> > >>>>> in
> > >>>>>>> the
> > >>>>>>>>>>>> future to allow for easier secret handling [1].
> > >>>>>>>>>>>> In my mental mind, I'm comparing this proposal against
> SQL/MED
> > >>>>> from
> > >>>>>>> the ISO
> > >>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
> > >>>> friendly
> > >>>>>>> syntax
> > >>>>>>>>>>>> though, looking at Postgres for example [3].
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> I think it's a valid question if Connection should be
> > >>>> considered
> > >>>>>>> with a
> > >>>>>>>>>>>> catalog or database-level scope. @Ryan can you share
> something
> > >>>>>> more,
> > >>>>>>> since
> > >>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this
> case.
> > >>>>> Which
> > >>>>>>> is what
> > >>>>>>>>>>>> we use internally to manage connection properties". It looks
> > >>>> like
> > >>>>>>> there
> > >>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
> > >>>>> (like,
> > >>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
> > >>>>>> database
> > >>>>>>>>>>>> level).
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> Also looking forward to Leonard's input.
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> Best regards,
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> Martijn
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> > >>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
> > >>>>>>>>>>>> [3]
> > >>>>> https://www.postgresql.org/docs/current/sql-createserver.html
> > >>>>>>>>>>>>
> > >>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <
> xbjtdcq@gmail.com
> > >
> > >>>>>>> wrote:
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>> Hey Mayank.
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
> > >>>> found
> > >>>>>> some
> > >>>>>>>>>>>>> issues which I think we
> > >>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon boat
> > >>>>>>> Festival,
> > >>>>>>>>>>>>> could you kindly hold
> > >>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
> > discuss.
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>> Best,
> > >>>>>>>>>>>>> Leonard
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
> > >>>> 写道:
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> Hi all,
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> Motivation:
> > >>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
> > >>>> defining
> > >>>>>>> endpoints
> > >>>>>>>>>>>>>> and credentials in table configuration. This approach
> > >>>> prevents
> > >>>>>>>>>>>>> reusability
> > >>>>>>>>>>>>>> of these connections and makes table definition less
> secure
> > >>>> by
> > >>>>>>> exposing
> > >>>>>>>>>>>>>> sensitive information.
> > >>>>>>>>>>>>>> We propose the introduction of a new "connection" resource
> > in
> > >>>>>>> Flink. This
> > >>>>>>>>>>>>>> will be a pluggable resource configured with a remote
> > >>>> endpoint
> > >>>>>> and
> > >>>>>>>>>>>>>> associated access key. Once defined, connections can be
> > >>>> reused
> > >>>>>>> across
> > >>>>>>>>>>>>> table
> > >>>>>>>>>>>>>> definitions, and eventually for model definition (as
> > >>>> discussed
> > >>>>> in
> > >>>>>>>>>>>>> FLIP-437)
> > >>>>>>>>>>>>>> for inference, enabling seamless and secure integration
> with
> > >>>>>>> external
> > >>>>>>>>>>>>>> systems.
> > >>>>>>>>>>>>>> The connection resource will provide a new, optional way
> to
> > >>>>>> manage
> > >>>>>>>>>>>>> external
> > >>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
> > definitions
> > >>>>>> will
> > >>>>>>> remain
> > >>>>>>>>>>>>>> unchanged.
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>> Best Regards,
> > >>>>>>>>>>>>>> Mayank Juneja
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>
> > >>>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>
> > >>>>>> --
> > >>>>>> *Mayank Juneja*
> > >>>>>> Product Manager | Data Streaming and AI
> > >>>>>>
> > >>>>>
> > >>>>
> > >>>
> > >>>
> > >>
> > >>
> >
> >
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hao Li <hl...@confluent.io.INVALID>.
Hi Timo,

Thanks for the suggestion. I updated the FLIP with `ObjectIdentifier`
taking only objectName and made it clear that the system connection uses
only a simple identifier instead of compound identifier.

Thanks,
Hao

On Thu, Jul 31, 2025 at 6:12 AM Timo Walther <tw...@apache.org> wrote:

> Thanks for updating the FLIP and starting a VOTE thread. I have two last
> minute questions before I cast my vote:
>
> It seems the definition of TEMPORARY SYSTEM CONNECTION is not precise
> enough. In my point of view, system connections are single part
> identifiers (similar to functions). And catalog connections are 3-part
> identifiers.
>
> So will we support the following DDL:
>
> CREATE TEMPORARY SYSTEM CONNECTION global_connection WITH (...);
>
> CREATE TABLE t (...) USING CONNECTION global_connection
>
> I think we should. But then we need to update the
> `CatalogTable.getConnection(): Optional<ObjectIdentifier>` interface,
> because ObjectIdentifier currently only supports 3 part identifiers.
>
> I suggest we modify ObjectIdentifier and let it have either 3 or 1 part.
> Then we can also remove the need for FunctionIdentifier which exists for
> exactly this purpose.
>
> What do you think?
>
> Cheers,
> Timo
>
>
> On 30.07.25 05:36, Leonard Xu wrote:
> > Thanks Hao for the effort to push the FLIP forward, I believe current
> design would satisfy most user cases.
> >
> > +1 to start a vote.
> >
> > Best,
> > Leonard
> >
> >> 2025 7月 30 02:27,Hao Li <hl...@confluent.io.INVALID> 写道:
> >>
> >> Sorry, I forgot to mention I also updated the FLIP to include table apis
> >> for connection. It was originally in examples but not in the public api
> >> section.
> >>
> >> On Tue, Jul 29, 2025 at 10:12 AM Hao Li <hl...@confluent.io> wrote:
> >>
> >>> Hi Leonard,
> >>>
> >>> Thanks for the feedback and offline sync yesterday.
> >>>
> >>>> I think connection is a very common need for most catalogs like
> >>> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs
> need
> >>> a connection.
> >>> I added `TEMPORARY SYSTEM` connection so it's a global level connection
> >>> which can be used for Catalog creation. After syncing with Timo, we
> propose
> >>> to store it first in memory like `TEMPORARY SYSTEM FUNCTION` since this
> >>> FLIP is already introducing lots of concepts and interfaces. We can
> provide
> >>> `SYSTEM` connection and related interfaces to persist it in following
> up
> >>> FLIPs.
> >>>
> >>>> In this case, I think reducing connector development cost is more
> >>> important than making is explicit, the connector knows which options is
> >>> sensitive or not.
> >>> Sure. I updated the FLIP to merge connection options with table
> options so
> >>> it's easier for current connectors.
> >>>
> >>>> I hope the BasicConnectionFactory can be a common one that can feed
> most
> >>> common users case, otherwise encrypt all options is a good idea.
> >>> I updated to `DefaultConnectionFactory` which handles most of the
> secret
> >>> keys.
> >>>
> >>> Thanks,
> >>> Hao
> >>>
> >>> On Mon, Jul 28, 2025 at 6:13 AM Leonard Xu <xb...@gmail.com> wrote:
> >>>
> >>>> Hey, Hao
> >>>>
> >>>> Please see my comments as follows:
> >>>>
> >>>>>> 2. I think we can also modify the create catalog ddl syntax.
> >>>>>
> >>>>> ```
> >>>>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> >>>>> WITH (
> >>>>>    'type' = 'jdbc'
> >>>>> );
> >>>>> ```
> >>>>>
> >>>>> Does `mycat.mydb.mysql_prod` exist in another catalog? This feels
> like a
> >>>>> chicken-egg problem. I think for connections to be used for catalog
> >>>>> creation, it needs to be system connection similar to system function
> >>>> which
> >>>>> exist outside of CatalogManager. Maybe we can defer this to later
> >>>>> functionality?
> >>>>
> >>>> I think connection is a very common need for most catalogs like
> >>>> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these
> catalogs need
> >>>> a connection.
> >>>>
> >>>>
> >>>>>> 3. It seems the connector factory should merge the with options and
> >>>>> connection options together and then create the source/sink. It's
> >>>>> better that framework can merge all these options and connectors
> don't
> >>>> need
> >>>>> any codes.
> >>>>>
> >>>>> I think it's better to separate connections with table options and
> make
> >>>> it
> >>>>> explicit. Reasons is: the connection here should be a decrypted one.
> >>>> It's
> >>>>> sensitive and should be handled carefully regarding logging, usage
> etc.
> >>>>> Mixing with original table options makes it hard to do. But the Flip
> >>>> used
> >>>>> `CatalogConnection` which is an encrypted one. I'll update it to
> >>>>> `SensitveConnection`.
> >>>>>> (4)Framework-level Resolution : +1 to Shengkai's point about having
> the
> >>>>> framework (DynamicTableFactory) return complete options to reduce
> >>>> connector
> >>>>> adaptation cost.
> >>>>>
> >>>>> Please see my explanation for Shengkai's similar question.
> >>>>
> >>>> In this case, I think reducing connector development cost is more
> >>>> important than making is explicit, the connector knows which options
> is
> >>>> sensitive or not.
> >>>>
> >>>>
> >>>>>> 4. Why we need to introduce ConnectionFactory? I think connection is
> >>>> like
> >>>>> CatalogTable. It should hold the basic information and all
> information
> >>>> in
> >>>>> the connection should be stored into secret store.
> >>>>>
> >>>>> The main reason is to enable user defined connection handling for
> >>>> different
> >>>>> types. For example, if connection type is `basic`, the corresponding
> >>>>> factory can handle basic type secrets (e.g. extract username/password
> >>>> from
> >>>>> connection options and do encryption).
> >>>>>
> >>>>>> (2) Configurability of SECRET_FIELDS : Could the hardcoded
> >>>> SECRET_FIELDS
> >>>>> in BasicConnectionFactory be made configurable (e.g., 'token' vs
> >>>>> 'accessKey') for better connector compatibility?
> >>>>>
> >>>>> This depends on `ConnectionFactory` implementation and can be self
> >>>> defined
> >>>>> by user.
> >>>>
> >>>> I hope the BasicConnectionFactory can be a common one that can feed
> most
> >>>> common users case, otherwise encrypt all options is a good idea.
> >>>>
> >>>> Btw, I also want to push the FLIP forward and start a vote ASAP, thus
> a
> >>>> meeting is welcome if you think it can help finalizing the discussion
> >>>> thread.
> >>>>
> >>>>
> >>>> Best,
> >>>> Leonard
> >>>>
> >>>>
> >>>>
> >>>>>
> >>>>>> Hi friends
> >>>>>>
> >>>>>> I like the updated FLIP goals, that’s what I want. I’ve some
> feedback:
> >>>>>>
> >>>>>> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore
> extend
> >>>>>> SecretStore?
> >>>>>> (2) Configurability of SECRET_FIELDS : Could the hardcoded
> >>>> SECRET_FIELDS
> >>>>>> in BasicConnectionFactory be made configurable (e.g., 'token' vs
> >>>>>> 'accessKey') for better connector compatibility?
> >>>>>> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
> >>>> returns
> >>>>>> SensitiveConnection, while BasicConnectionFactory#resolveConnection
> >>>> returns
> >>>>>> Map<String, String>. Should these be aligned?
> >>>>>> (4)Framework-level Resolution : +1 to Shengkai's point about having
> the
> >>>>>> framework (DynamicTableFactory) return complete options to reduce
> >>>> connector
> >>>>>> adaptation cost.
> >>>>>> (5)Secret ID Handling : When no encryption is needed, secretId is
> null
> >>>>>> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)).
> >>>> This
> >>>>>> behavior should be explicitly documented in the interfaces.
> >>>>>>
> >>>>>> Best,
> >>>>>> Leonard
> >>>>>>
> >>>>>>> 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
> >>>>>>>
> >>>>>>> hi.
> >>>>>>>
> >>>>>>> Sorry for the late reply. I just have some questions:
> >>>>>>>
> >>>>>>> 1. Why SecretStoreFactory#open throws a CatalogException? I think
> the
> >>>>>>> exteranl system can not handle this exception.
> >>>>>>>
> >>>>>>> 2. I think we can also modify the create catalog ddl syntax.
> >>>>>>>
> >>>>>>> ```
> >>>>>>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> >>>>>>> WITH (
> >>>>>>>   'type' = 'jdbc'
> >>>>>>> );
> >>>>>>> ```
> >>>>>>>
> >>>>>>> 3. It seems the connector factory should merge the with options and
> >>>>>>> connection options together and then create the source/sink. It's
> >>>>>>> better that framework can merge all these options and connectors
> don't
> >>>>>> need
> >>>>>>> any codes.
> >>>>>>>
> >>>>>>> 4. Why we need to introduce ConnectionFactory? I think connection
> is
> >>>> like
> >>>>>>> CatalogTable. It should hold the basic information and all
> >>>> information in
> >>>>>>> the connection should be stored into secret store.
> >>>>>>>
> >>>>>>>
> >>>>>>> Best,
> >>>>>>> Shengkai
> >>>>>>>
> >>>>>>>
> >>>>>>> Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
> >>>>>>>
> >>>>>>>> Hi Mayank,
> >>>>>>>>
> >>>>>>>> Thanks for updating the FLIP and clearly documenting our
> discussion.
> >>>>>>>>
> >>>>>>>> +1 for moving forward with the vote, unless there are objections
> from
> >>>>>>>> others.
> >>>>>>>>
> >>>>>>>> Cheers,
> >>>>>>>> Timo
> >>>>>>>>
> >>>>>>>> On 22.07.25 02:14, Mayank Juneja wrote:
> >>>>>>>>> Hi Ryan and Austin,
> >>>>>>>>>
> >>>>>>>>> Thanks for your suggestions. I've updated the FLIP with the
> >>>> following
> >>>>>>>>> additional info -
> >>>>>>>>>
> >>>>>>>>> 1. *table.secret-store.kind* key to register the SecretStore in a
> >>>> yaml
> >>>>>>>> file
> >>>>>>>>> 2. *updateSecret* method in WritableSecretStore interface
> >>>>>>>>>
> >>>>>>>>> Thanks,
> >>>>>>>>> Mayank
> >>>>>>>>>
> >>>>>>>>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
> >>>>>>>>> austin.cawley@gmail.com> wrote:
> >>>>>>>>>
> >>>>>>>>>> Hey all,
> >>>>>>>>>>
> >>>>>>>>>> Thanks for the nice flip all! I’m just reading through – had one
> >>>>>>>> question
> >>>>>>>>>> on the ALTER CONNECTION implementation flow. Would it make sense
> >>>> for
> >>>>>> the
> >>>>>>>>>> WritableSecretStore to expose a method for updating a secret by
> >>>> ID, so
> >>>>>>>> it
> >>>>>>>>>> can be done atomically? Else, would we need to call delete and
> >>>> create
> >>>>>>>>>> again, potentially introducing concurrent resolution errors?
> >>>>>>>>>>
> >>>>>>>>>> Best,
> >>>>>>>>>> Austin
> >>>>>>>>>>
> >>>>>>>>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
> >>>>>>>>>> <ry...@shopify.com.invalid> wrote:
> >>>>>>>>>>
> >>>>>>>>>>> Hi Mayank,
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks for updating the FLIP. Overall it looks good to me.
> >>>>>>>>>>>
> >>>>>>>>>>> One question I had related to how someone could choose the
> >>>>>> SecretStore
> >>>>>>>>>> they
> >>>>>>>>>>> want to use if they use something like the SQL Gateway as the
> >>>>>>>> entrypoint
> >>>>>>>>>> on
> >>>>>>>>>>> top of a remote Session cluster. I don't see an explicit way to
> >>>> set
> >>>>>> the
> >>>>>>>>>>> SecretStore in the FLIP.
> >>>>>>>>>>> I assume we'll do it similar to the CatalogStore but I wanted
> to
> >>>> call
> >>>>>>>>>> this
> >>>>>>>>>>> out.
> >>>>>>>>>>>
> >>>>>>>>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
> >>>>>>>>>>> file:///path/to/catalog/store/
> >>>>>>>>>>>
> >>>>>>>>>>> Ryan van Huuksloot
> >>>>>>>>>>> Staff Engineer, Infrastructure | Streaming Platform
> >>>>>>>>>>> [image: Shopify]
> >>>>>>>>>>> <
> >>>>>>>>
> >>>>
> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
> >>>>>>>> mayankjuneja27@gmail.com>
> >>>>>>>>>>> wrote:
> >>>>>>>>>>>
> >>>>>>>>>>>> Hi everyone,
> >>>>>>>>>>>>
> >>>>>>>>>>>> Thanks for your valuable inputs. I have updated the FLIP with
> the
> >>>>>>>> ideas
> >>>>>>>>>>>> proposed earlier in the thread. Looking forward to your
> feedback.
> >>>>>>>>>>>> https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>>>>>>>
> >>>>>>>>>>>> Best,
> >>>>>>>>>>>> Mayank
> >>>>>>>>>>>>
> >>>>>>>>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xbjtdcq@gmail.com
> >
> >>>>>> wrote:
> >>>>>>>>>>>>
> >>>>>>>>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.
> The
> >>>>>> new
> >>>>>>>>>>>>> proposal looks well, +1 from my side.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Could you draft(update) current FLIP docs thus we can have
> some
> >>>>>>>>>>> specific
> >>>>>>>>>>>>> discussions later?
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Best,
> >>>>>>>>>>>>> Leonard
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Hi everyone,
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> sorry for the late reply, feature freeze kept me busy.
> Mayank,
> >>>> Hao
> >>>>>>>>>>> and
> >>>>>>>>>>>> I
> >>>>>>>>>>>>> synced offline and came up we an improved proposal. Before we
> >>>>>> update
> >>>>>>>>>>> the
> >>>>>>>>>>>>> FLIP let me summarize the most important key facts that
> >>>> hopefully
> >>>>>>>>>>> address
> >>>>>>>>>>>>> most concerns:
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> 1) SecretStore
> >>>>>>>>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
> >>>>>>>>>> highest
> >>>>>>>>>>>>> level in TableEnvironment.
> >>>>>>>>>>>>>> - SecretStore is initialized with options and potentially
> >>>>>>>>>> environment
> >>>>>>>>>>>>> variables. Including
> >>>>>>>>>> EnvironmentSettings.withSecretStore(SecretStore).
> >>>>>>>>>>>>>> - The SecretStore is pluggable and discovered using the
> regular
> >>>>>>>>>>>>> factory-approach.
> >>>>>>>>>>>>>> - For example, it could implement Azure Key Vault or other
> >>>> cloud
> >>>>>>>>>>>>> provider secrets stores.
> >>>>>>>>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
> >>>>>> sensitive
> >>>>>>>>>>>> data.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> 2) Connections
> >>>>>>>>>>>>>> - Connections are catalog objects identified with 3-part
> >>>>>>>>>> identifiers.
> >>>>>>>>>>>>> 3-part identifiers are crucial for managability of larger
> >>>> projects
> >>>>>>>>>> and
> >>>>>>>>>>>>> align with existing catalog objects.
> >>>>>>>>>>>>>> - They contain connection details, e.g. URL, query
> parameters,
> >>>> and
> >>>>>>>>>>>> other
> >>>>>>>>>>>>> configuration.
> >>>>>>>>>>>>>> - They do not contain secrets, but only pointers to secrets
> in
> >>>> the
> >>>>>>>>>>>>> SecretStore.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> 3) Connection DDL
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>>>>>>> 'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> >>>>>>>>>>>>>> ...
> >>>>>>>>>>>>>> )
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> - Connection type is pluggable and discovered using the
> regular
> >>>>>>>>>>>>> factory-approach.
> >>>>>>>>>>>>>> - The factory extracts secrets and puts them into
> SecretStore.
> >>>>>>>>>>>>>> - The factory only leaves non-confidential options left that
> >>>> can
> >>>>>> be
> >>>>>>>>>>>>> stored in a catalog.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> When executing:
> >>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>>>>>>> 'type' = 'basic',
> >>>>>>>>>>>>>> 'url' = 'api.example.com',
> >>>>>>>>>>>>>> 'username' = 'bob',
> >>>>>>>>>>>>>> 'password' = 'xyz'
> >>>>>>>>>>>>>> )
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> The catalog will receive something similar to:
> >>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>>>>>>> 'type' = 'basic',
> >>>>>>>>>>>>>> 'url' = 'api.example.com',
> >>>>>>>>>>>>>> 'secret.store' = 'azure-key-vault'
> >>>>>>>>>>>>>> 'secret.id' = 'secretId'
> >>>>>>>>>>>>>> )
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> - However, the exact property design is up to the connection
> >>>>>>>>>> factory.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> 4) Connection Usage
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION
> >>>> keyword
> >>>>>>>>>>>>> similar to BigQuery.
> >>>>>>>>>>>>>> - The connection will be provided in a table/model
> >>>>>>>>>> provider/function
> >>>>>>>>>>>>> definition factory.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> 5) CatalogStore / Catalog Initialization
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Catalog store or catalog can make use of SecretStore to
> >>>> retrieve
> >>>>>>>>>>>> initial
> >>>>>>>>>>>>> credentials for bootstrapping. All objects lower then catalog
> >>>>>>>>>>>> store/catalog
> >>>>>>>>>>>>> can then use connections. If you think we still need system
> >>>> level
> >>>>>>>>>>>>> connections, we can support CREATE SYSTEM CONNECTION
> GlobalName
> >>>>>> WITH
> >>>>>>>>>>> (..)
> >>>>>>>>>>>>> similar to SYSTEM functions directly store in a
> >>>> ConnectioManager in
> >>>>>>>>>>>>> TableEnvironment. But for now I would suggest to start simple
> >>>> with
> >>>>>>>>>>>>> per-catalog connections and later evolve the design.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Dealing with secrets is a very sensitive topic and I'm
> clearly
> >>>> not
> >>>>>>>>>> an
> >>>>>>>>>>>>> expert on it. This is why we should try to push the problem
> to
> >>>>>>>>>> existing
> >>>>>>>>>>>>> solutions and don't start storing secrets in Flink in any
> way.
> >>>>>> Thus,
> >>>>>>>>>>> the
> >>>>>>>>>>>>> interfaces will be defined very generic.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Looking forward to your feedback.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Cheers,
> >>>>>>>>>>>>>> Timo
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
> >>>>>>>>>>>>>>> Thanks  Timo for joining this thread.
> >>>>>>>>>>>>>>> I agree that this feature is needed by the community; the
> >>>> current
> >>>>>>>>>>>>> disagreement is only about the implementation method or
> >>>> solution.
> >>>>>>>>>>>>>>> Your thoughts looks generally good to me, looking forward
> to
> >>>> your
> >>>>>>>>>>>>> proposal.
> >>>>>>>>>>>>>>> Best,
> >>>>>>>>>>>>>>> Leonard
> >>>>>>>>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Hi everyone,
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> thanks for this healthy discussion. Looking at high
> number of
> >>>>>>>>>>>>> participants, it looks like we definitely want this feature.
> We
> >>>>>> just
> >>>>>>>>>>> need
> >>>>>>>>>>>>> to figure out the "how".
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> This reminds me very much of the discussion we had for
> CREATE
> >>>>>>>>>>>>> FUNCTION. There, we discussed whether functions should be
> named
> >>>>>>>>>>> globally
> >>>>>>>>>>>> or
> >>>>>>>>>>>>> catalog-specific. In the end, we decided for both `CREATE
> SYSTEM
> >>>>>>>>>>>> FUNCTION`
> >>>>>>>>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team
> >>>> of an
> >>>>>>>>>>>>> organization (which might provide system functions) and
> >>>> individual
> >>>>>>>>>> data
> >>>>>>>>>>>>> teams or use cases (scoped by catalog/database).
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Looking at other modern vendors like Snowflake there is
> >>>> SECRET
> >>>>>>>>>>>> (scoped
> >>>>>>>>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account).
> So
> >>>> also
> >>>>>>>>>>> other
> >>>>>>>>>>>>> vendors offer global and per-team / per-use case connections
> >>>>>> details.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> In general, I think fitting connections into the existing
> >>>>>>>>>> concepts
> >>>>>>>>>>>> for
> >>>>>>>>>>>>> catalog objects (with three-part identifier) makes managing
> them
> >>>>>>>>>>> easier.
> >>>>>>>>>>>>> But I also see the need for global defaults.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Btw keep in mind that a catalog implementation should only
> >>>> store
> >>>>>>>>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
> >>>>>> data, a
> >>>>>>>>>>>>> CatalogConnection should not store the credentials. It should
> >>>> only
> >>>>>>>>>>> offer
> >>>>>>>>>>>> a
> >>>>>>>>>>>>> factory that allows for storing and retrieving them. In real
> >>>> world
> >>>>>>>>>>>>> scenarios a factory is most likely backed by a product like
> >>>> Azure
> >>>>>> Key
> >>>>>>>>>>>> Vault.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> So code-wise having a ConnectionManager that behaves
> similar
> >>>> to
> >>>>>>>>>>>>> FunctionManager sounds reasonable.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> +1 for having special syntax instead of using properties.
> >>>> This
> >>>>>>>>>>> allows
> >>>>>>>>>>>>> to access connections in tables, models, functions. And
> >>>> catalogs,
> >>>>>> if
> >>>>>>>>>> we
> >>>>>>>>>>>>> agree to have global ones as well.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> What do you think?
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Let me spend some more thoughts on this and come back
> with a
> >>>>>>>>>>> concrete
> >>>>>>>>>>>>> proposal by early next week.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Cheers,
> >>>>>>>>>>>>>>>> Timo
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> [1]
> >>>>>>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
> >>>>>>>>>>>>>>>> [2]
> >>>>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>
> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
> >>>>>>>>>>>>>>>>> Hey,Mayank
> >>>>>>>>>>>>>>>>> Please see my feedback as following:
> >>>>>>>>>>>>>>>>> 1. One of the motivations of this FLIP is to improve
> >>>> security.
> >>>>>>>>>>>>> However, the current design stores all connection
> information in
> >>>>>> the
> >>>>>>>>>>>>> catalog,
> >>>>>>>>>>>>>>>>> and each Flink SQL job reads from the catalog during
> >>>>>>>>>> compilation.
> >>>>>>>>>>>> The
> >>>>>>>>>>>>> connection information is passed between SQL Gateway and the
> >>>>>>>>>>>>>>>>> catalog in plaintext, which actually introduces new
> security
> >>>>>>>>>>> risks.
> >>>>>>>>>>>>>>>>> 2. The name "Connection" should be changed to something
> like
> >>>>>>>>>>>>> ConnectionSpec to clearly indicate that it is a object
> >>>> containing
> >>>>>>>>>> only
> >>>>>>>>>>>>> static
> >>>>>>>>>>>>>>>>> properties without a lifecycle. Putting aside the naming
> >>>> issue,
> >>>>>>>>>> I
> >>>>>>>>>>>>> think the current model and hierarchy design is somewhat
> >>>> strange.
> >>>>>>>>>>> Storing
> >>>>>>>>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the
> >>>> same
> >>>>>>>>>>>> Catalog
> >>>>>>>>>>>>> with hierarchical identifiers like
> >>>>>>>>>> catalog-name.db-name.connection-name
> >>>>>>>>>>>>>>>>> raises the following questions:
> >>>>>>>>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
> >>>>>>>>>>> Connection
> >>>>>>>>>>>>> object ?
> >>>>>>>>>>>>>>>>> (2) If we can use a Connection to create a MySQL table,
> why
> >>>>>>>>>> can't
> >>>>>>>>>>> we
> >>>>>>>>>>>>> use a Connection to create a MySQL Catalog?
> >>>>>>>>>>>>>>>>> 3. Regarding the connector usage examples given in this
> >>>> FLIP:
> >>>>>>>>>>>>>>>>> ```sql
> >>>>>>>>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
> >>>>>>>>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> >>>>>>>>>>>>>>>>> 3  WITH (
> >>>>>>>>>>>>>>>>> 4    'type' = 'jdbc',
> >>>>>>>>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
> >>>>>>>>>>>>> customer-db.example.com:3306/customerdb',
> >>>>>>>>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> >>>>>>>>>>>>>>>>> 7  );
> >>>>>>>>>>>>>>>>> 8
> >>>>>>>>>>>>>>>>> 9  CREATE TABLE customers (
> >>>>>>>>>>>>>>>>> 10   customer_id INT,
> >>>>>>>>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> >>>>>>>>>>>>>>>>> 12 ) WITH (
> >>>>>>>>>>>>>>>>> 13   'connector' = 'jdbc',
> >>>>>>>>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
> >>>>>>>>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> >>>>>>>>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> >>>>>>>>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
> >>>>>>>>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> >>>>>>>>>>>>>>>>> 19 );
> >>>>>>>>>>>>>>>>> ```
> >>>>>>>>>>>>>>>>> I see three issues from SQL semantics and Connector
> >>>>>>>>>> compatibility
> >>>>>>>>>>>>> perspectives:
> >>>>>>>>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
> >>>>>> identifier
> >>>>>>>>>>> of
> >>>>>>>>>>>> a
> >>>>>>>>>>>>> CONNECTION defined in SQL. However, this identifier is
> >>>> referenced
> >>>>>>>>>>>>>>>>>    via a string value inside the table’s WITH clause,
> which
> >>>>>>>>>> feel
> >>>>>>>>>>>>> hack for me.
> >>>>>>>>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
> >>>>>>>>>>>>> `jdbc.connection` will confuse users because `connection.xx`
> >>>> maybe
> >>>>>>>>>>>> already
> >>>>>>>>>>>>> used as
> >>>>>>>>>>>>>>>>> a prefix for existing configuration items.
> >>>>>>>>>>>>>>>>> (3) Look at lines 14–18: Why do all existing
> configuration
> >>>>>>>>>> options
> >>>>>>>>>>>>> need to be prefixed with `jdbc`, even they’re not related to
> >>>>>>>>>> Connection
> >>>>>>>>>>>>> properties?
> >>>>>>>>>>>>>>>>> This completely changes user habits — is it backward
> >>>>>> compatible?
> >>>>>>>>>>>>>>>>> In my opinion, Connection should be a model independent
> of
> >>>>>> both
> >>>>>>>>>>>>> Catalog and Table, and can be referenced by all
> >>>>>>>>>> catalog/table/udf/model
> >>>>>>>>>>>>> object.
> >>>>>>>>>>>>>>>>> It should be managed by a Component such as a
> >>>> ConnectionManager
> >>>>>>>>>> to
> >>>>>>>>>>>>> enable reuse. For security purposes, authentication
> mechanisms
> >>>>>> could
> >>>>>>>>>>>>>>>>> be supported within the ConnectionManager.
> >>>>>>>>>>>>>>>>> Best,
> >>>>>>>>>>>>>>>>> Leonard
> >>>>>>>>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <
> martijnvisser@apache.org>
> >>>> 写道:
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> Hi all,
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> First of all, I think having a Connection resource is
> >>>>>> something
> >>>>>>>>>>>> that
> >>>>>>>>>>>>> will
> >>>>>>>>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
> >>>>>> extended
> >>>>>>>>>>> in
> >>>>>>>>>>>>> the
> >>>>>>>>>>>>>>>>>> future to allow for easier secret handling [1].
> >>>>>>>>>>>>>>>>>> In my mental mind, I'm comparing this proposal against
> >>>> SQL/MED
> >>>>>>>>>>> from
> >>>>>>>>>>>>> the ISO
> >>>>>>>>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
> >>>>>>>>>> friendly
> >>>>>>>>>>>>> syntax
> >>>>>>>>>>>>>>>>>> though, looking at Postgres for example [3].
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> I think it's a valid question if Connection should be
> >>>>>>>>>> considered
> >>>>>>>>>>>>> with a
> >>>>>>>>>>>>>>>>>> catalog or database-level scope. @Ryan can you share
> >>>> something
> >>>>>>>>>>>> more,
> >>>>>>>>>>>>> since
> >>>>>>>>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this
> >>>> case.
> >>>>>>>>>>> Which
> >>>>>>>>>>>>> is what
> >>>>>>>>>>>>>>>>>> we use internally to manage connection properties". It
> >>>> looks
> >>>>>>>>>> like
> >>>>>>>>>>>>> there
> >>>>>>>>>>>>>>>>>> isn't a strong favourable approach looking at other
> vendors
> >>>>>>>>>>> (like,
> >>>>>>>>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake
> on
> >>>> a
> >>>>>>>>>>>> database
> >>>>>>>>>>>>>>>>>> level).
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> Also looking forward to Leonard's input.
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> Best regards,
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> Martijn
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> >>>>>>>>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
> >>>>>>>>>>>>>>>>>> [3]
> >>>>>>>>>>> https://www.postgresql.org/docs/current/sql-createserver.html
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <
> >>>> xbjtdcq@gmail.com
> >>>>>>>
> >>>>>>>>>>>>> wrote:
> >>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>> Hey Mayank.
> >>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly
> and
> >>>>>>>>>> found
> >>>>>>>>>>>> some
> >>>>>>>>>>>>>>>>>>> issues which I think we
> >>>>>>>>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon
> >>>> boat
> >>>>>>>>>>>>> Festival,
> >>>>>>>>>>>>>>>>>>> could you kindly hold
> >>>>>>>>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
> >>>>>> discuss.
> >>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>> Best,
> >>>>>>>>>>>>>>>>>>> Leonard
> >>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <
> mayankjuneja27@gmail.com
> >>>>>
> >>>>>>>>>> 写道:
> >>>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>> Hi all,
> >>>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529
> >>>> [1].
> >>>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>> Motivation:
> >>>>>>>>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
> >>>>>>>>>> defining
> >>>>>>>>>>>>> endpoints
> >>>>>>>>>>>>>>>>>>>> and credentials in table configuration. This approach
> >>>>>>>>>> prevents
> >>>>>>>>>>>>>>>>>>> reusability
> >>>>>>>>>>>>>>>>>>>> of these connections and makes table definition less
> >>>> secure
> >>>>>>>>>> by
> >>>>>>>>>>>>> exposing
> >>>>>>>>>>>>>>>>>>>> sensitive information.
> >>>>>>>>>>>>>>>>>>>> We propose the introduction of a new "connection"
> >>>> resource
> >>>>>> in
> >>>>>>>>>>>>> Flink. This
> >>>>>>>>>>>>>>>>>>>> will be a pluggable resource configured with a remote
> >>>>>>>>>> endpoint
> >>>>>>>>>>>> and
> >>>>>>>>>>>>>>>>>>>> associated access key. Once defined, connections can
> be
> >>>>>>>>>> reused
> >>>>>>>>>>>>> across
> >>>>>>>>>>>>>>>>>>> table
> >>>>>>>>>>>>>>>>>>>> definitions, and eventually for model definition (as
> >>>>>>>>>> discussed
> >>>>>>>>>>> in
> >>>>>>>>>>>>>>>>>>> FLIP-437)
> >>>>>>>>>>>>>>>>>>>> for inference, enabling seamless and secure
> integration
> >>>> with
> >>>>>>>>>>>>> external
> >>>>>>>>>>>>>>>>>>>> systems.
> >>>>>>>>>>>>>>>>>>>> The connection resource will provide a new, optional
> way
> >>>> to
> >>>>>>>>>>>> manage
> >>>>>>>>>>>>>>>>>>> external
> >>>>>>>>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
> >>>>>> definitions
> >>>>>>>>>>>> will
> >>>>>>>>>>>>> remain
> >>>>>>>>>>>>>>>>>>>> unchanged.
> >>>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>> Best Regards,
> >>>>>>>>>>>>>>>>>>>> Mayank Juneja
> >>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> --
> >>>>>>>>>>>> *Mayank Juneja*
> >>>>>>>>>>>> Product Manager | Data Streaming and AI
> >>>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >
>
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
> I suggest we modify ObjectIdentifier and let it have either 3 or 1 part. Then we can also remove the need for FunctionIdentifier which exists for exactly this purpose.

+1 from my side 

Best,
Leonard



Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Timo Walther <tw...@apache.org>.
Thanks for updating the FLIP and starting a VOTE thread. I have two last 
minute questions before I cast my vote:

It seems the definition of TEMPORARY SYSTEM CONNECTION is not precise 
enough. In my point of view, system connections are single part 
identifiers (similar to functions). And catalog connections are 3-part 
identifiers.

So will we support the following DDL:

CREATE TEMPORARY SYSTEM CONNECTION global_connection WITH (...);

CREATE TABLE t (...) USING CONNECTION global_connection

I think we should. But then we need to update the 
`CatalogTable.getConnection(): Optional<ObjectIdentifier>` interface, 
because ObjectIdentifier currently only supports 3 part identifiers.

I suggest we modify ObjectIdentifier and let it have either 3 or 1 part. 
Then we can also remove the need for FunctionIdentifier which exists for 
exactly this purpose.

What do you think?

Cheers,
Timo


On 30.07.25 05:36, Leonard Xu wrote:
> Thanks Hao for the effort to push the FLIP forward, I believe current design would satisfy most user cases.
> 
> +1 to start a vote.
> 
> Best,
> Leonard
> 
>> 2025 7月 30 02:27,Hao Li <hl...@confluent.io.INVALID> 写道:
>>
>> Sorry, I forgot to mention I also updated the FLIP to include table apis
>> for connection. It was originally in examples but not in the public api
>> section.
>>
>> On Tue, Jul 29, 2025 at 10:12 AM Hao Li <hl...@confluent.io> wrote:
>>
>>> Hi Leonard,
>>>
>>> Thanks for the feedback and offline sync yesterday.
>>>
>>>> I think connection is a very common need for most catalogs like
>>> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
>>> a connection.
>>> I added `TEMPORARY SYSTEM` connection so it's a global level connection
>>> which can be used for Catalog creation. After syncing with Timo, we propose
>>> to store it first in memory like `TEMPORARY SYSTEM FUNCTION` since this
>>> FLIP is already introducing lots of concepts and interfaces. We can provide
>>> `SYSTEM` connection and related interfaces to persist it in following up
>>> FLIPs.
>>>
>>>> In this case, I think reducing connector development cost is more
>>> important than making is explicit, the connector knows which options is
>>> sensitive or not.
>>> Sure. I updated the FLIP to merge connection options with table options so
>>> it's easier for current connectors.
>>>
>>>> I hope the BasicConnectionFactory can be a common one that can feed most
>>> common users case, otherwise encrypt all options is a good idea.
>>> I updated to `DefaultConnectionFactory` which handles most of the secret
>>> keys.
>>>
>>> Thanks,
>>> Hao
>>>
>>> On Mon, Jul 28, 2025 at 6:13 AM Leonard Xu <xb...@gmail.com> wrote:
>>>
>>>> Hey, Hao
>>>>
>>>> Please see my comments as follows:
>>>>
>>>>>> 2. I think we can also modify the create catalog ddl syntax.
>>>>>
>>>>> ```
>>>>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
>>>>> WITH (
>>>>>    'type' = 'jdbc'
>>>>> );
>>>>> ```
>>>>>
>>>>> Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
>>>>> chicken-egg problem. I think for connections to be used for catalog
>>>>> creation, it needs to be system connection similar to system function
>>>> which
>>>>> exist outside of CatalogManager. Maybe we can defer this to later
>>>>> functionality?
>>>>
>>>> I think connection is a very common need for most catalogs like
>>>> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
>>>> a connection.
>>>>
>>>>
>>>>>> 3. It seems the connector factory should merge the with options and
>>>>> connection options together and then create the source/sink. It's
>>>>> better that framework can merge all these options and connectors don't
>>>> need
>>>>> any codes.
>>>>>
>>>>> I think it's better to separate connections with table options and make
>>>> it
>>>>> explicit. Reasons is: the connection here should be a decrypted one.
>>>> It's
>>>>> sensitive and should be handled carefully regarding logging, usage etc.
>>>>> Mixing with original table options makes it hard to do. But the Flip
>>>> used
>>>>> `CatalogConnection` which is an encrypted one. I'll update it to
>>>>> `SensitveConnection`.
>>>>>> (4)Framework-level Resolution : +1 to Shengkai's point about having the
>>>>> framework (DynamicTableFactory) return complete options to reduce
>>>> connector
>>>>> adaptation cost.
>>>>>
>>>>> Please see my explanation for Shengkai's similar question.
>>>>
>>>> In this case, I think reducing connector development cost is more
>>>> important than making is explicit, the connector knows which options is
>>>> sensitive or not.
>>>>
>>>>
>>>>>> 4. Why we need to introduce ConnectionFactory? I think connection is
>>>> like
>>>>> CatalogTable. It should hold the basic information and all information
>>>> in
>>>>> the connection should be stored into secret store.
>>>>>
>>>>> The main reason is to enable user defined connection handling for
>>>> different
>>>>> types. For example, if connection type is `basic`, the corresponding
>>>>> factory can handle basic type secrets (e.g. extract username/password
>>>> from
>>>>> connection options and do encryption).
>>>>>
>>>>>> (2) Configurability of SECRET_FIELDS : Could the hardcoded
>>>> SECRET_FIELDS
>>>>> in BasicConnectionFactory be made configurable (e.g., 'token' vs
>>>>> 'accessKey') for better connector compatibility?
>>>>>
>>>>> This depends on `ConnectionFactory` implementation and can be self
>>>> defined
>>>>> by user.
>>>>
>>>> I hope the BasicConnectionFactory can be a common one that can feed most
>>>> common users case, otherwise encrypt all options is a good idea.
>>>>
>>>> Btw, I also want to push the FLIP forward and start a vote ASAP, thus a
>>>> meeting is welcome if you think it can help finalizing the discussion
>>>> thread.
>>>>
>>>>
>>>> Best,
>>>> Leonard
>>>>
>>>>
>>>>
>>>>>
>>>>>> Hi friends
>>>>>>
>>>>>> I like the updated FLIP goals, that’s what I want. I’ve some feedback:
>>>>>>
>>>>>> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
>>>>>> SecretStore?
>>>>>> (2) Configurability of SECRET_FIELDS : Could the hardcoded
>>>> SECRET_FIELDS
>>>>>> in BasicConnectionFactory be made configurable (e.g., 'token' vs
>>>>>> 'accessKey') for better connector compatibility?
>>>>>> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
>>>> returns
>>>>>> SensitiveConnection, while BasicConnectionFactory#resolveConnection
>>>> returns
>>>>>> Map<String, String>. Should these be aligned?
>>>>>> (4)Framework-level Resolution : +1 to Shengkai's point about having the
>>>>>> framework (DynamicTableFactory) return complete options to reduce
>>>> connector
>>>>>> adaptation cost.
>>>>>> (5)Secret ID Handling : When no encryption is needed, secretId is null
>>>>>> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)).
>>>> This
>>>>>> behavior should be explicitly documented in the interfaces.
>>>>>>
>>>>>> Best,
>>>>>> Leonard
>>>>>>
>>>>>>> 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
>>>>>>>
>>>>>>> hi.
>>>>>>>
>>>>>>> Sorry for the late reply. I just have some questions:
>>>>>>>
>>>>>>> 1. Why SecretStoreFactory#open throws a CatalogException? I think the
>>>>>>> exteranl system can not handle this exception.
>>>>>>>
>>>>>>> 2. I think we can also modify the create catalog ddl syntax.
>>>>>>>
>>>>>>> ```
>>>>>>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
>>>>>>> WITH (
>>>>>>>   'type' = 'jdbc'
>>>>>>> );
>>>>>>> ```
>>>>>>>
>>>>>>> 3. It seems the connector factory should merge the with options and
>>>>>>> connection options together and then create the source/sink. It's
>>>>>>> better that framework can merge all these options and connectors don't
>>>>>> need
>>>>>>> any codes.
>>>>>>>
>>>>>>> 4. Why we need to introduce ConnectionFactory? I think connection is
>>>> like
>>>>>>> CatalogTable. It should hold the basic information and all
>>>> information in
>>>>>>> the connection should be stored into secret store.
>>>>>>>
>>>>>>>
>>>>>>> Best,
>>>>>>> Shengkai
>>>>>>>
>>>>>>>
>>>>>>> Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
>>>>>>>
>>>>>>>> Hi Mayank,
>>>>>>>>
>>>>>>>> Thanks for updating the FLIP and clearly documenting our discussion.
>>>>>>>>
>>>>>>>> +1 for moving forward with the vote, unless there are objections from
>>>>>>>> others.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Timo
>>>>>>>>
>>>>>>>> On 22.07.25 02:14, Mayank Juneja wrote:
>>>>>>>>> Hi Ryan and Austin,
>>>>>>>>>
>>>>>>>>> Thanks for your suggestions. I've updated the FLIP with the
>>>> following
>>>>>>>>> additional info -
>>>>>>>>>
>>>>>>>>> 1. *table.secret-store.kind* key to register the SecretStore in a
>>>> yaml
>>>>>>>> file
>>>>>>>>> 2. *updateSecret* method in WritableSecretStore interface
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Mayank
>>>>>>>>>
>>>>>>>>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
>>>>>>>>> austin.cawley@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hey all,
>>>>>>>>>>
>>>>>>>>>> Thanks for the nice flip all! I’m just reading through – had one
>>>>>>>> question
>>>>>>>>>> on the ALTER CONNECTION implementation flow. Would it make sense
>>>> for
>>>>>> the
>>>>>>>>>> WritableSecretStore to expose a method for updating a secret by
>>>> ID, so
>>>>>>>> it
>>>>>>>>>> can be done atomically? Else, would we need to call delete and
>>>> create
>>>>>>>>>> again, potentially introducing concurrent resolution errors?
>>>>>>>>>>
>>>>>>>>>> Best,
>>>>>>>>>> Austin
>>>>>>>>>>
>>>>>>>>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
>>>>>>>>>> <ry...@shopify.com.invalid> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi Mayank,
>>>>>>>>>>>
>>>>>>>>>>> Thanks for updating the FLIP. Overall it looks good to me.
>>>>>>>>>>>
>>>>>>>>>>> One question I had related to how someone could choose the
>>>>>> SecretStore
>>>>>>>>>> they
>>>>>>>>>>> want to use if they use something like the SQL Gateway as the
>>>>>>>> entrypoint
>>>>>>>>>> on
>>>>>>>>>>> top of a remote Session cluster. I don't see an explicit way to
>>>> set
>>>>>> the
>>>>>>>>>>> SecretStore in the FLIP.
>>>>>>>>>>> I assume we'll do it similar to the CatalogStore but I wanted to
>>>> call
>>>>>>>>>> this
>>>>>>>>>>> out.
>>>>>>>>>>>
>>>>>>>>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
>>>>>>>>>>> file:///path/to/catalog/store/
>>>>>>>>>>>
>>>>>>>>>>> Ryan van Huuksloot
>>>>>>>>>>> Staff Engineer, Infrastructure | Streaming Platform
>>>>>>>>>>> [image: Shopify]
>>>>>>>>>>> <
>>>>>>>>
>>>> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
>>>>>>>> mayankjuneja27@gmail.com>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi everyone,
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
>>>>>>>> ideas
>>>>>>>>>>>> proposed earlier in the thread. Looking forward to your feedback.
>>>>>>>>>>>> https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>>>>>>
>>>>>>>>>>>> Best,
>>>>>>>>>>>> Mayank
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The
>>>>>> new
>>>>>>>>>>>>> proposal looks well, +1 from my side.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Could you draft(update) current FLIP docs thus we can have some
>>>>>>>>>>> specific
>>>>>>>>>>>>> discussions later?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best,
>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi everyone,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank,
>>>> Hao
>>>>>>>>>>> and
>>>>>>>>>>>> I
>>>>>>>>>>>>> synced offline and came up we an improved proposal. Before we
>>>>>> update
>>>>>>>>>>> the
>>>>>>>>>>>>> FLIP let me summarize the most important key facts that
>>>> hopefully
>>>>>>>>>>> address
>>>>>>>>>>>>> most concerns:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 1) SecretStore
>>>>>>>>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
>>>>>>>>>> highest
>>>>>>>>>>>>> level in TableEnvironment.
>>>>>>>>>>>>>> - SecretStore is initialized with options and potentially
>>>>>>>>>> environment
>>>>>>>>>>>>> variables. Including
>>>>>>>>>> EnvironmentSettings.withSecretStore(SecretStore).
>>>>>>>>>>>>>> - The SecretStore is pluggable and discovered using the regular
>>>>>>>>>>>>> factory-approach.
>>>>>>>>>>>>>> - For example, it could implement Azure Key Vault or other
>>>> cloud
>>>>>>>>>>>>> provider secrets stores.
>>>>>>>>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
>>>>>> sensitive
>>>>>>>>>>>> data.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 2) Connections
>>>>>>>>>>>>>> - Connections are catalog objects identified with 3-part
>>>>>>>>>> identifiers.
>>>>>>>>>>>>> 3-part identifiers are crucial for managability of larger
>>>> projects
>>>>>>>>>> and
>>>>>>>>>>>>> align with existing catalog objects.
>>>>>>>>>>>>>> - They contain connection details, e.g. URL, query parameters,
>>>> and
>>>>>>>>>>>> other
>>>>>>>>>>>>> configuration.
>>>>>>>>>>>>>> - They do not contain secrets, but only pointers to secrets in
>>>> the
>>>>>>>>>>>>> SecretStore.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 3) Connection DDL
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>>>>>> 'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>>>>>>>>>>>>>> ...
>>>>>>>>>>>>>> )
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> - Connection type is pluggable and discovered using the regular
>>>>>>>>>>>>> factory-approach.
>>>>>>>>>>>>>> - The factory extracts secrets and puts them into SecretStore.
>>>>>>>>>>>>>> - The factory only leaves non-confidential options left that
>>>> can
>>>>>> be
>>>>>>>>>>>>> stored in a catalog.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> When executing:
>>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>>>>>> 'type' = 'basic',
>>>>>>>>>>>>>> 'url' = 'api.example.com',
>>>>>>>>>>>>>> 'username' = 'bob',
>>>>>>>>>>>>>> 'password' = 'xyz'
>>>>>>>>>>>>>> )
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> The catalog will receive something similar to:
>>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>>>>>> 'type' = 'basic',
>>>>>>>>>>>>>> 'url' = 'api.example.com',
>>>>>>>>>>>>>> 'secret.store' = 'azure-key-vault'
>>>>>>>>>>>>>> 'secret.id' = 'secretId'
>>>>>>>>>>>>>> )
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> - However, the exact property design is up to the connection
>>>>>>>>>> factory.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 4) Connection Usage
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION
>>>> keyword
>>>>>>>>>>>>> similar to BigQuery.
>>>>>>>>>>>>>> - The connection will be provided in a table/model
>>>>>>>>>> provider/function
>>>>>>>>>>>>> definition factory.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 5) CatalogStore / Catalog Initialization
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Catalog store or catalog can make use of SecretStore to
>>>> retrieve
>>>>>>>>>>>> initial
>>>>>>>>>>>>> credentials for bootstrapping. All objects lower then catalog
>>>>>>>>>>>> store/catalog
>>>>>>>>>>>>> can then use connections. If you think we still need system
>>>> level
>>>>>>>>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
>>>>>> WITH
>>>>>>>>>>> (..)
>>>>>>>>>>>>> similar to SYSTEM functions directly store in a
>>>> ConnectioManager in
>>>>>>>>>>>>> TableEnvironment. But for now I would suggest to start simple
>>>> with
>>>>>>>>>>>>> per-catalog connections and later evolve the design.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly
>>>> not
>>>>>>>>>> an
>>>>>>>>>>>>> expert on it. This is why we should try to push the problem to
>>>>>>>>>> existing
>>>>>>>>>>>>> solutions and don't start storing secrets in Flink in any way.
>>>>>> Thus,
>>>>>>>>>>> the
>>>>>>>>>>>>> interfaces will be defined very generic.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Looking forward to your feedback.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Cheers,
>>>>>>>>>>>>>> Timo
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
>>>>>>>>>>>>>>> Thanks  Timo for joining this thread.
>>>>>>>>>>>>>>> I agree that this feature is needed by the community; the
>>>> current
>>>>>>>>>>>>> disagreement is only about the implementation method or
>>>> solution.
>>>>>>>>>>>>>>> Your thoughts looks generally good to me, looking forward to
>>>> your
>>>>>>>>>>>>> proposal.
>>>>>>>>>>>>>>> Best,
>>>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi everyone,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> thanks for this healthy discussion. Looking at high number of
>>>>>>>>>>>>> participants, it looks like we definitely want this feature. We
>>>>>> just
>>>>>>>>>>> need
>>>>>>>>>>>>> to figure out the "how".
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> This reminds me very much of the discussion we had for CREATE
>>>>>>>>>>>>> FUNCTION. There, we discussed whether functions should be named
>>>>>>>>>>> globally
>>>>>>>>>>>> or
>>>>>>>>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
>>>>>>>>>>>> FUNCTION`
>>>>>>>>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team
>>>> of an
>>>>>>>>>>>>> organization (which might provide system functions) and
>>>> individual
>>>>>>>>>> data
>>>>>>>>>>>>> teams or use cases (scoped by catalog/database).
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Looking at other modern vendors like Snowflake there is
>>>> SECRET
>>>>>>>>>>>> (scoped
>>>>>>>>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So
>>>> also
>>>>>>>>>>> other
>>>>>>>>>>>>> vendors offer global and per-team / per-use case connections
>>>>>> details.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> In general, I think fitting connections into the existing
>>>>>>>>>> concepts
>>>>>>>>>>>> for
>>>>>>>>>>>>> catalog objects (with three-part identifier) makes managing them
>>>>>>>>>>> easier.
>>>>>>>>>>>>> But I also see the need for global defaults.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Btw keep in mind that a catalog implementation should only
>>>> store
>>>>>>>>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
>>>>>> data, a
>>>>>>>>>>>>> CatalogConnection should not store the credentials. It should
>>>> only
>>>>>>>>>>> offer
>>>>>>>>>>>> a
>>>>>>>>>>>>> factory that allows for storing and retrieving them. In real
>>>> world
>>>>>>>>>>>>> scenarios a factory is most likely backed by a product like
>>>> Azure
>>>>>> Key
>>>>>>>>>>>> Vault.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> So code-wise having a ConnectionManager that behaves similar
>>>> to
>>>>>>>>>>>>> FunctionManager sounds reasonable.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> +1 for having special syntax instead of using properties.
>>>> This
>>>>>>>>>>> allows
>>>>>>>>>>>>> to access connections in tables, models, functions. And
>>>> catalogs,
>>>>>> if
>>>>>>>>>> we
>>>>>>>>>>>>> agree to have global ones as well.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> What do you think?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Let me spend some more thoughts on this and come back with a
>>>>>>>>>>> concrete
>>>>>>>>>>>>> proposal by early next week.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Cheers,
>>>>>>>>>>>>>>>> Timo
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> [1]
>>>>>>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
>>>>>>>>>>>>>>>> [2]
>>>>>>>>>>>>>
>>>>>>>>>>
>>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
>>>>>>>>>>>>>>>>> Hey,Mayank
>>>>>>>>>>>>>>>>> Please see my feedback as following:
>>>>>>>>>>>>>>>>> 1. One of the motivations of this FLIP is to improve
>>>> security.
>>>>>>>>>>>>> However, the current design stores all connection information in
>>>>>> the
>>>>>>>>>>>>> catalog,
>>>>>>>>>>>>>>>>> and each Flink SQL job reads from the catalog during
>>>>>>>>>> compilation.
>>>>>>>>>>>> The
>>>>>>>>>>>>> connection information is passed between SQL Gateway and the
>>>>>>>>>>>>>>>>> catalog in plaintext, which actually introduces new security
>>>>>>>>>>> risks.
>>>>>>>>>>>>>>>>> 2. The name "Connection" should be changed to something like
>>>>>>>>>>>>> ConnectionSpec to clearly indicate that it is a object
>>>> containing
>>>>>>>>>> only
>>>>>>>>>>>>> static
>>>>>>>>>>>>>>>>> properties without a lifecycle. Putting aside the naming
>>>> issue,
>>>>>>>>>> I
>>>>>>>>>>>>> think the current model and hierarchy design is somewhat
>>>> strange.
>>>>>>>>>>> Storing
>>>>>>>>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the
>>>> same
>>>>>>>>>>>> Catalog
>>>>>>>>>>>>> with hierarchical identifiers like
>>>>>>>>>> catalog-name.db-name.connection-name
>>>>>>>>>>>>>>>>> raises the following questions:
>>>>>>>>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
>>>>>>>>>>> Connection
>>>>>>>>>>>>> object ?
>>>>>>>>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
>>>>>>>>>> can't
>>>>>>>>>>> we
>>>>>>>>>>>>> use a Connection to create a MySQL Catalog?
>>>>>>>>>>>>>>>>> 3. Regarding the connector usage examples given in this
>>>> FLIP:
>>>>>>>>>>>>>>>>> ```sql
>>>>>>>>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
>>>>>>>>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>>>>>>>>>>>>>>>>> 3  WITH (
>>>>>>>>>>>>>>>>> 4    'type' = 'jdbc',
>>>>>>>>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
>>>>>>>>>>>>> customer-db.example.com:3306/customerdb',
>>>>>>>>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>>>>>>>>>>>>>>>>> 7  );
>>>>>>>>>>>>>>>>> 8
>>>>>>>>>>>>>>>>> 9  CREATE TABLE customers (
>>>>>>>>>>>>>>>>> 10   customer_id INT,
>>>>>>>>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>>>>>>>>>>>>>>>>> 12 ) WITH (
>>>>>>>>>>>>>>>>> 13   'connector' = 'jdbc',
>>>>>>>>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
>>>>>>>>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>>>>>>>>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>>>>>>>>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
>>>>>>>>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>>>>>>>>>>>>>>>>> 19 );
>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>> I see three issues from SQL semantics and Connector
>>>>>>>>>> compatibility
>>>>>>>>>>>>> perspectives:
>>>>>>>>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
>>>>>> identifier
>>>>>>>>>>> of
>>>>>>>>>>>> a
>>>>>>>>>>>>> CONNECTION defined in SQL. However, this identifier is
>>>> referenced
>>>>>>>>>>>>>>>>>    via a string value inside the table’s WITH clause, which
>>>>>>>>>> feel
>>>>>>>>>>>>> hack for me.
>>>>>>>>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
>>>>>>>>>>>>> `jdbc.connection` will confuse users because `connection.xx`
>>>> maybe
>>>>>>>>>>>> already
>>>>>>>>>>>>> used as
>>>>>>>>>>>>>>>>> a prefix for existing configuration items.
>>>>>>>>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
>>>>>>>>>> options
>>>>>>>>>>>>> need to be prefixed with `jdbc`, even they’re not related to
>>>>>>>>>> Connection
>>>>>>>>>>>>> properties?
>>>>>>>>>>>>>>>>> This completely changes user habits — is it backward
>>>>>> compatible?
>>>>>>>>>>>>>>>>> In my opinion, Connection should be a model independent of
>>>>>> both
>>>>>>>>>>>>> Catalog and Table, and can be referenced by all
>>>>>>>>>> catalog/table/udf/model
>>>>>>>>>>>>> object.
>>>>>>>>>>>>>>>>> It should be managed by a Component such as a
>>>> ConnectionManager
>>>>>>>>>> to
>>>>>>>>>>>>> enable reuse. For security purposes, authentication mechanisms
>>>>>> could
>>>>>>>>>>>>>>>>> be supported within the ConnectionManager.
>>>>>>>>>>>>>>>>> Best,
>>>>>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org>
>>>> 写道:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> First of all, I think having a Connection resource is
>>>>>> something
>>>>>>>>>>>> that
>>>>>>>>>>>>> will
>>>>>>>>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
>>>>>> extended
>>>>>>>>>>> in
>>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>>> future to allow for easier secret handling [1].
>>>>>>>>>>>>>>>>>> In my mental mind, I'm comparing this proposal against
>>>> SQL/MED
>>>>>>>>>>> from
>>>>>>>>>>>>> the ISO
>>>>>>>>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
>>>>>>>>>> friendly
>>>>>>>>>>>>> syntax
>>>>>>>>>>>>>>>>>> though, looking at Postgres for example [3].
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I think it's a valid question if Connection should be
>>>>>>>>>> considered
>>>>>>>>>>>>> with a
>>>>>>>>>>>>>>>>>> catalog or database-level scope. @Ryan can you share
>>>> something
>>>>>>>>>>>> more,
>>>>>>>>>>>>> since
>>>>>>>>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this
>>>> case.
>>>>>>>>>>> Which
>>>>>>>>>>>>> is what
>>>>>>>>>>>>>>>>>> we use internally to manage connection properties". It
>>>> looks
>>>>>>>>>> like
>>>>>>>>>>>>> there
>>>>>>>>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
>>>>>>>>>>> (like,
>>>>>>>>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on
>>>> a
>>>>>>>>>>>> database
>>>>>>>>>>>>>>>>>> level).
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Also looking forward to Leonard's input.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Best regards,
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Martijn
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>>>>>>>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
>>>>>>>>>>>>>>>>>> [3]
>>>>>>>>>>> https://www.postgresql.org/docs/current/sql-createserver.html
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <
>>>> xbjtdcq@gmail.com
>>>>>>>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Hey Mayank.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
>>>>>>>>>> found
>>>>>>>>>>>> some
>>>>>>>>>>>>>>>>>>> issues which I think we
>>>>>>>>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon
>>>> boat
>>>>>>>>>>>>> Festival,
>>>>>>>>>>>>>>>>>>> could you kindly hold
>>>>>>>>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
>>>>>> discuss.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> Best,
>>>>>>>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <mayankjuneja27@gmail.com
>>>>>
>>>>>>>>>> 写道:
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529
>>>> [1].
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Motivation:
>>>>>>>>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
>>>>>>>>>> defining
>>>>>>>>>>>>> endpoints
>>>>>>>>>>>>>>>>>>>> and credentials in table configuration. This approach
>>>>>>>>>> prevents
>>>>>>>>>>>>>>>>>>> reusability
>>>>>>>>>>>>>>>>>>>> of these connections and makes table definition less
>>>> secure
>>>>>>>>>> by
>>>>>>>>>>>>> exposing
>>>>>>>>>>>>>>>>>>>> sensitive information.
>>>>>>>>>>>>>>>>>>>> We propose the introduction of a new "connection"
>>>> resource
>>>>>> in
>>>>>>>>>>>>> Flink. This
>>>>>>>>>>>>>>>>>>>> will be a pluggable resource configured with a remote
>>>>>>>>>> endpoint
>>>>>>>>>>>> and
>>>>>>>>>>>>>>>>>>>> associated access key. Once defined, connections can be
>>>>>>>>>> reused
>>>>>>>>>>>>> across
>>>>>>>>>>>>>>>>>>> table
>>>>>>>>>>>>>>>>>>>> definitions, and eventually for model definition (as
>>>>>>>>>> discussed
>>>>>>>>>>> in
>>>>>>>>>>>>>>>>>>> FLIP-437)
>>>>>>>>>>>>>>>>>>>> for inference, enabling seamless and secure integration
>>>> with
>>>>>>>>>>>>> external
>>>>>>>>>>>>>>>>>>>> systems.
>>>>>>>>>>>>>>>>>>>> The connection resource will provide a new, optional way
>>>> to
>>>>>>>>>>>> manage
>>>>>>>>>>>>>>>>>>> external
>>>>>>>>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
>>>>>> definitions
>>>>>>>>>>>> will
>>>>>>>>>>>>> remain
>>>>>>>>>>>>>>>>>>>> unchanged.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>>>>>> Mayank Juneja
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> *Mayank Juneja*
>>>>>>>>>>>> Product Manager | Data Streaming and AI
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
Thanks Hao for the effort to push the FLIP forward, I believe current design would satisfy most user cases.

+1 to start a vote.  

Best,
Leonard

> 2025 7月 30 02:27,Hao Li <hl...@confluent.io.INVALID> 写道:
> 
> Sorry, I forgot to mention I also updated the FLIP to include table apis
> for connection. It was originally in examples but not in the public api
> section.
> 
> On Tue, Jul 29, 2025 at 10:12 AM Hao Li <hl...@confluent.io> wrote:
> 
>> Hi Leonard,
>> 
>> Thanks for the feedback and offline sync yesterday.
>> 
>>> I think connection is a very common need for most catalogs like
>> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
>> a connection.
>> I added `TEMPORARY SYSTEM` connection so it's a global level connection
>> which can be used for Catalog creation. After syncing with Timo, we propose
>> to store it first in memory like `TEMPORARY SYSTEM FUNCTION` since this
>> FLIP is already introducing lots of concepts and interfaces. We can provide
>> `SYSTEM` connection and related interfaces to persist it in following up
>> FLIPs.
>> 
>>> In this case, I think reducing connector development cost is more
>> important than making is explicit, the connector knows which options is
>> sensitive or not.
>> Sure. I updated the FLIP to merge connection options with table options so
>> it's easier for current connectors.
>> 
>>> I hope the BasicConnectionFactory can be a common one that can feed most
>> common users case, otherwise encrypt all options is a good idea.
>> I updated to `DefaultConnectionFactory` which handles most of the secret
>> keys.
>> 
>> Thanks,
>> Hao
>> 
>> On Mon, Jul 28, 2025 at 6:13 AM Leonard Xu <xb...@gmail.com> wrote:
>> 
>>> Hey, Hao
>>> 
>>> Please see my comments as follows:
>>> 
>>>>> 2. I think we can also modify the create catalog ddl syntax.
>>>> 
>>>> ```
>>>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
>>>> WITH (
>>>>   'type' = 'jdbc'
>>>> );
>>>> ```
>>>> 
>>>> Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
>>>> chicken-egg problem. I think for connections to be used for catalog
>>>> creation, it needs to be system connection similar to system function
>>> which
>>>> exist outside of CatalogManager. Maybe we can defer this to later
>>>> functionality?
>>> 
>>> I think connection is a very common need for most catalogs like
>>> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
>>> a connection.
>>> 
>>> 
>>>>> 3. It seems the connector factory should merge the with options and
>>>> connection options together and then create the source/sink. It's
>>>> better that framework can merge all these options and connectors don't
>>> need
>>>> any codes.
>>>> 
>>>> I think it's better to separate connections with table options and make
>>> it
>>>> explicit. Reasons is: the connection here should be a decrypted one.
>>> It's
>>>> sensitive and should be handled carefully regarding logging, usage etc.
>>>> Mixing with original table options makes it hard to do. But the Flip
>>> used
>>>> `CatalogConnection` which is an encrypted one. I'll update it to
>>>> `SensitveConnection`.
>>>>> (4)Framework-level Resolution : +1 to Shengkai's point about having the
>>>> framework (DynamicTableFactory) return complete options to reduce
>>> connector
>>>> adaptation cost.
>>>> 
>>>> Please see my explanation for Shengkai's similar question.
>>> 
>>> In this case, I think reducing connector development cost is more
>>> important than making is explicit, the connector knows which options is
>>> sensitive or not.
>>> 
>>> 
>>>>> 4. Why we need to introduce ConnectionFactory? I think connection is
>>> like
>>>> CatalogTable. It should hold the basic information and all information
>>> in
>>>> the connection should be stored into secret store.
>>>> 
>>>> The main reason is to enable user defined connection handling for
>>> different
>>>> types. For example, if connection type is `basic`, the corresponding
>>>> factory can handle basic type secrets (e.g. extract username/password
>>> from
>>>> connection options and do encryption).
>>>> 
>>>>> (2) Configurability of SECRET_FIELDS : Could the hardcoded
>>> SECRET_FIELDS
>>>> in BasicConnectionFactory be made configurable (e.g., 'token' vs
>>>> 'accessKey') for better connector compatibility?
>>>> 
>>>> This depends on `ConnectionFactory` implementation and can be self
>>> defined
>>>> by user.
>>> 
>>> I hope the BasicConnectionFactory can be a common one that can feed most
>>> common users case, otherwise encrypt all options is a good idea.
>>> 
>>> Btw, I also want to push the FLIP forward and start a vote ASAP, thus a
>>> meeting is welcome if you think it can help finalizing the discussion
>>> thread.
>>> 
>>> 
>>> Best,
>>> Leonard
>>> 
>>> 
>>> 
>>>> 
>>>>> Hi friends
>>>>> 
>>>>> I like the updated FLIP goals, that’s what I want. I’ve some feedback:
>>>>> 
>>>>> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
>>>>> SecretStore?
>>>>> (2) Configurability of SECRET_FIELDS : Could the hardcoded
>>> SECRET_FIELDS
>>>>> in BasicConnectionFactory be made configurable (e.g., 'token' vs
>>>>> 'accessKey') for better connector compatibility?
>>>>> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
>>> returns
>>>>> SensitiveConnection, while BasicConnectionFactory#resolveConnection
>>> returns
>>>>> Map<String, String>. Should these be aligned?
>>>>> (4)Framework-level Resolution : +1 to Shengkai's point about having the
>>>>> framework (DynamicTableFactory) return complete options to reduce
>>> connector
>>>>> adaptation cost.
>>>>> (5)Secret ID Handling : When no encryption is needed, secretId is null
>>>>> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)).
>>> This
>>>>> behavior should be explicitly documented in the interfaces.
>>>>> 
>>>>> Best,
>>>>> Leonard
>>>>> 
>>>>>> 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
>>>>>> 
>>>>>> hi.
>>>>>> 
>>>>>> Sorry for the late reply. I just have some questions:
>>>>>> 
>>>>>> 1. Why SecretStoreFactory#open throws a CatalogException? I think the
>>>>>> exteranl system can not handle this exception.
>>>>>> 
>>>>>> 2. I think we can also modify the create catalog ddl syntax.
>>>>>> 
>>>>>> ```
>>>>>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
>>>>>> WITH (
>>>>>>  'type' = 'jdbc'
>>>>>> );
>>>>>> ```
>>>>>> 
>>>>>> 3. It seems the connector factory should merge the with options and
>>>>>> connection options together and then create the source/sink. It's
>>>>>> better that framework can merge all these options and connectors don't
>>>>> need
>>>>>> any codes.
>>>>>> 
>>>>>> 4. Why we need to introduce ConnectionFactory? I think connection is
>>> like
>>>>>> CatalogTable. It should hold the basic information and all
>>> information in
>>>>>> the connection should be stored into secret store.
>>>>>> 
>>>>>> 
>>>>>> Best,
>>>>>> Shengkai
>>>>>> 
>>>>>> 
>>>>>> Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
>>>>>> 
>>>>>>> Hi Mayank,
>>>>>>> 
>>>>>>> Thanks for updating the FLIP and clearly documenting our discussion.
>>>>>>> 
>>>>>>> +1 for moving forward with the vote, unless there are objections from
>>>>>>> others.
>>>>>>> 
>>>>>>> Cheers,
>>>>>>> Timo
>>>>>>> 
>>>>>>> On 22.07.25 02:14, Mayank Juneja wrote:
>>>>>>>> Hi Ryan and Austin,
>>>>>>>> 
>>>>>>>> Thanks for your suggestions. I've updated the FLIP with the
>>> following
>>>>>>>> additional info -
>>>>>>>> 
>>>>>>>> 1. *table.secret-store.kind* key to register the SecretStore in a
>>> yaml
>>>>>>> file
>>>>>>>> 2. *updateSecret* method in WritableSecretStore interface
>>>>>>>> 
>>>>>>>> Thanks,
>>>>>>>> Mayank
>>>>>>>> 
>>>>>>>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
>>>>>>>> austin.cawley@gmail.com> wrote:
>>>>>>>> 
>>>>>>>>> Hey all,
>>>>>>>>> 
>>>>>>>>> Thanks for the nice flip all! I’m just reading through – had one
>>>>>>> question
>>>>>>>>> on the ALTER CONNECTION implementation flow. Would it make sense
>>> for
>>>>> the
>>>>>>>>> WritableSecretStore to expose a method for updating a secret by
>>> ID, so
>>>>>>> it
>>>>>>>>> can be done atomically? Else, would we need to call delete and
>>> create
>>>>>>>>> again, potentially introducing concurrent resolution errors?
>>>>>>>>> 
>>>>>>>>> Best,
>>>>>>>>> Austin
>>>>>>>>> 
>>>>>>>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
>>>>>>>>> <ry...@shopify.com.invalid> wrote:
>>>>>>>>> 
>>>>>>>>>> Hi Mayank,
>>>>>>>>>> 
>>>>>>>>>> Thanks for updating the FLIP. Overall it looks good to me.
>>>>>>>>>> 
>>>>>>>>>> One question I had related to how someone could choose the
>>>>> SecretStore
>>>>>>>>> they
>>>>>>>>>> want to use if they use something like the SQL Gateway as the
>>>>>>> entrypoint
>>>>>>>>> on
>>>>>>>>>> top of a remote Session cluster. I don't see an explicit way to
>>> set
>>>>> the
>>>>>>>>>> SecretStore in the FLIP.
>>>>>>>>>> I assume we'll do it similar to the CatalogStore but I wanted to
>>> call
>>>>>>>>> this
>>>>>>>>>> out.
>>>>>>>>>> 
>>>>>>>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
>>>>>>>>>> file:///path/to/catalog/store/
>>>>>>>>>> 
>>>>>>>>>> Ryan van Huuksloot
>>>>>>>>>> Staff Engineer, Infrastructure | Streaming Platform
>>>>>>>>>> [image: Shopify]
>>>>>>>>>> <
>>>>>>> 
>>> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
>>>>>>> mayankjuneja27@gmail.com>
>>>>>>>>>> wrote:
>>>>>>>>>> 
>>>>>>>>>>> Hi everyone,
>>>>>>>>>>> 
>>>>>>>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
>>>>>>> ideas
>>>>>>>>>>> proposed earlier in the thread. Looking forward to your feedback.
>>>>>>>>>>> https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>>>>> 
>>>>>>>>>>> Best,
>>>>>>>>>>> Mayank
>>>>>>>>>>> 
>>>>>>>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
>>>>> wrote:
>>>>>>>>>>> 
>>>>>>>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The
>>>>> new
>>>>>>>>>>>> proposal looks well, +1 from my side.
>>>>>>>>>>>> 
>>>>>>>>>>>> Could you draft(update) current FLIP docs thus we can have some
>>>>>>>>>> specific
>>>>>>>>>>>> discussions later?
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> Best,
>>>>>>>>>>>> Leonard
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Hi everyone,
>>>>>>>>>>>>> 
>>>>>>>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank,
>>> Hao
>>>>>>>>>> and
>>>>>>>>>>> I
>>>>>>>>>>>> synced offline and came up we an improved proposal. Before we
>>>>> update
>>>>>>>>>> the
>>>>>>>>>>>> FLIP let me summarize the most important key facts that
>>> hopefully
>>>>>>>>>> address
>>>>>>>>>>>> most concerns:
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 1) SecretStore
>>>>>>>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
>>>>>>>>> highest
>>>>>>>>>>>> level in TableEnvironment.
>>>>>>>>>>>>> - SecretStore is initialized with options and potentially
>>>>>>>>> environment
>>>>>>>>>>>> variables. Including
>>>>>>>>> EnvironmentSettings.withSecretStore(SecretStore).
>>>>>>>>>>>>> - The SecretStore is pluggable and discovered using the regular
>>>>>>>>>>>> factory-approach.
>>>>>>>>>>>>> - For example, it could implement Azure Key Vault or other
>>> cloud
>>>>>>>>>>>> provider secrets stores.
>>>>>>>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
>>>>> sensitive
>>>>>>>>>>> data.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 2) Connections
>>>>>>>>>>>>> - Connections are catalog objects identified with 3-part
>>>>>>>>> identifiers.
>>>>>>>>>>>> 3-part identifiers are crucial for managability of larger
>>> projects
>>>>>>>>> and
>>>>>>>>>>>> align with existing catalog objects.
>>>>>>>>>>>>> - They contain connection details, e.g. URL, query parameters,
>>> and
>>>>>>>>>>> other
>>>>>>>>>>>> configuration.
>>>>>>>>>>>>> - They do not contain secrets, but only pointers to secrets in
>>> the
>>>>>>>>>>>> SecretStore.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 3) Connection DDL
>>>>>>>>>>>>> 
>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>>>>> 'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>>>>>>>>>>>>> ...
>>>>>>>>>>>>> )
>>>>>>>>>>>>> 
>>>>>>>>>>>>> - Connection type is pluggable and discovered using the regular
>>>>>>>>>>>> factory-approach.
>>>>>>>>>>>>> - The factory extracts secrets and puts them into SecretStore.
>>>>>>>>>>>>> - The factory only leaves non-confidential options left that
>>> can
>>>>> be
>>>>>>>>>>>> stored in a catalog.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> When executing:
>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>>>>> 'type' = 'basic',
>>>>>>>>>>>>> 'url' = 'api.example.com',
>>>>>>>>>>>>> 'username' = 'bob',
>>>>>>>>>>>>> 'password' = 'xyz'
>>>>>>>>>>>>> )
>>>>>>>>>>>>> 
>>>>>>>>>>>>> The catalog will receive something similar to:
>>>>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>>>>> 'type' = 'basic',
>>>>>>>>>>>>> 'url' = 'api.example.com',
>>>>>>>>>>>>> 'secret.store' = 'azure-key-vault'
>>>>>>>>>>>>> 'secret.id' = 'secretId'
>>>>>>>>>>>>> )
>>>>>>>>>>>>> 
>>>>>>>>>>>>> - However, the exact property design is up to the connection
>>>>>>>>> factory.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 4) Connection Usage
>>>>>>>>>>>>> 
>>>>>>>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
>>>>>>>>>>>>> 
>>>>>>>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION
>>> keyword
>>>>>>>>>>>> similar to BigQuery.
>>>>>>>>>>>>> - The connection will be provided in a table/model
>>>>>>>>> provider/function
>>>>>>>>>>>> definition factory.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 5) CatalogStore / Catalog Initialization
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Catalog store or catalog can make use of SecretStore to
>>> retrieve
>>>>>>>>>>> initial
>>>>>>>>>>>> credentials for bootstrapping. All objects lower then catalog
>>>>>>>>>>> store/catalog
>>>>>>>>>>>> can then use connections. If you think we still need system
>>> level
>>>>>>>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
>>>>> WITH
>>>>>>>>>> (..)
>>>>>>>>>>>> similar to SYSTEM functions directly store in a
>>> ConnectioManager in
>>>>>>>>>>>> TableEnvironment. But for now I would suggest to start simple
>>> with
>>>>>>>>>>>> per-catalog connections and later evolve the design.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly
>>> not
>>>>>>>>> an
>>>>>>>>>>>> expert on it. This is why we should try to push the problem to
>>>>>>>>> existing
>>>>>>>>>>>> solutions and don't start storing secrets in Flink in any way.
>>>>> Thus,
>>>>>>>>>> the
>>>>>>>>>>>> interfaces will be defined very generic.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Looking forward to your feedback.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Cheers,
>>>>>>>>>>>>> Timo
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
>>>>>>>>>>>>>> Thanks  Timo for joining this thread.
>>>>>>>>>>>>>> I agree that this feature is needed by the community; the
>>> current
>>>>>>>>>>>> disagreement is only about the implementation method or
>>> solution.
>>>>>>>>>>>>>> Your thoughts looks generally good to me, looking forward to
>>> your
>>>>>>>>>>>> proposal.
>>>>>>>>>>>>>> Best,
>>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Hi everyone,
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> thanks for this healthy discussion. Looking at high number of
>>>>>>>>>>>> participants, it looks like we definitely want this feature. We
>>>>> just
>>>>>>>>>> need
>>>>>>>>>>>> to figure out the "how".
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> This reminds me very much of the discussion we had for CREATE
>>>>>>>>>>>> FUNCTION. There, we discussed whether functions should be named
>>>>>>>>>> globally
>>>>>>>>>>> or
>>>>>>>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
>>>>>>>>>>> FUNCTION`
>>>>>>>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team
>>> of an
>>>>>>>>>>>> organization (which might provide system functions) and
>>> individual
>>>>>>>>> data
>>>>>>>>>>>> teams or use cases (scoped by catalog/database).
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Looking at other modern vendors like Snowflake there is
>>> SECRET
>>>>>>>>>>> (scoped
>>>>>>>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So
>>> also
>>>>>>>>>> other
>>>>>>>>>>>> vendors offer global and per-team / per-use case connections
>>>>> details.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> In general, I think fitting connections into the existing
>>>>>>>>> concepts
>>>>>>>>>>> for
>>>>>>>>>>>> catalog objects (with three-part identifier) makes managing them
>>>>>>>>>> easier.
>>>>>>>>>>>> But I also see the need for global defaults.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Btw keep in mind that a catalog implementation should only
>>> store
>>>>>>>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
>>>>> data, a
>>>>>>>>>>>> CatalogConnection should not store the credentials. It should
>>> only
>>>>>>>>>> offer
>>>>>>>>>>> a
>>>>>>>>>>>> factory that allows for storing and retrieving them. In real
>>> world
>>>>>>>>>>>> scenarios a factory is most likely backed by a product like
>>> Azure
>>>>> Key
>>>>>>>>>>> Vault.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> So code-wise having a ConnectionManager that behaves similar
>>> to
>>>>>>>>>>>> FunctionManager sounds reasonable.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> +1 for having special syntax instead of using properties.
>>> This
>>>>>>>>>> allows
>>>>>>>>>>>> to access connections in tables, models, functions. And
>>> catalogs,
>>>>> if
>>>>>>>>> we
>>>>>>>>>>>> agree to have global ones as well.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> What do you think?
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Let me spend some more thoughts on this and come back with a
>>>>>>>>>> concrete
>>>>>>>>>>>> proposal by early next week.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Cheers,
>>>>>>>>>>>>>>> Timo
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> [1]
>>>>>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
>>>>>>>>>>>>>>> [2]
>>>>>>>>>>>> 
>>>>>>>>> 
>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
>>>>>>>>>>>>>>>> Hey,Mayank
>>>>>>>>>>>>>>>> Please see my feedback as following:
>>>>>>>>>>>>>>>> 1. One of the motivations of this FLIP is to improve
>>> security.
>>>>>>>>>>>> However, the current design stores all connection information in
>>>>> the
>>>>>>>>>>>> catalog,
>>>>>>>>>>>>>>>> and each Flink SQL job reads from the catalog during
>>>>>>>>> compilation.
>>>>>>>>>>> The
>>>>>>>>>>>> connection information is passed between SQL Gateway and the
>>>>>>>>>>>>>>>> catalog in plaintext, which actually introduces new security
>>>>>>>>>> risks.
>>>>>>>>>>>>>>>> 2. The name "Connection" should be changed to something like
>>>>>>>>>>>> ConnectionSpec to clearly indicate that it is a object
>>> containing
>>>>>>>>> only
>>>>>>>>>>>> static
>>>>>>>>>>>>>>>> properties without a lifecycle. Putting aside the naming
>>> issue,
>>>>>>>>> I
>>>>>>>>>>>> think the current model and hierarchy design is somewhat
>>> strange.
>>>>>>>>>> Storing
>>>>>>>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the
>>> same
>>>>>>>>>>> Catalog
>>>>>>>>>>>> with hierarchical identifiers like
>>>>>>>>> catalog-name.db-name.connection-name
>>>>>>>>>>>>>>>> raises the following questions:
>>>>>>>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
>>>>>>>>>> Connection
>>>>>>>>>>>> object ?
>>>>>>>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
>>>>>>>>> can't
>>>>>>>>>> we
>>>>>>>>>>>> use a Connection to create a MySQL Catalog?
>>>>>>>>>>>>>>>> 3. Regarding the connector usage examples given in this
>>> FLIP:
>>>>>>>>>>>>>>>> ```sql
>>>>>>>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
>>>>>>>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>>>>>>>>>>>>>>>> 3  WITH (
>>>>>>>>>>>>>>>> 4    'type' = 'jdbc',
>>>>>>>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
>>>>>>>>>>>> customer-db.example.com:3306/customerdb',
>>>>>>>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>>>>>>>>>>>>>>>> 7  );
>>>>>>>>>>>>>>>> 8
>>>>>>>>>>>>>>>> 9  CREATE TABLE customers (
>>>>>>>>>>>>>>>> 10   customer_id INT,
>>>>>>>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>>>>>>>>>>>>>>>> 12 ) WITH (
>>>>>>>>>>>>>>>> 13   'connector' = 'jdbc',
>>>>>>>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
>>>>>>>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>>>>>>>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>>>>>>>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
>>>>>>>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>>>>>>>>>>>>>>>> 19 );
>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>> I see three issues from SQL semantics and Connector
>>>>>>>>> compatibility
>>>>>>>>>>>> perspectives:
>>>>>>>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
>>>>> identifier
>>>>>>>>>> of
>>>>>>>>>>> a
>>>>>>>>>>>> CONNECTION defined in SQL. However, this identifier is
>>> referenced
>>>>>>>>>>>>>>>>   via a string value inside the table’s WITH clause, which
>>>>>>>>> feel
>>>>>>>>>>>> hack for me.
>>>>>>>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
>>>>>>>>>>>> `jdbc.connection` will confuse users because `connection.xx`
>>> maybe
>>>>>>>>>>> already
>>>>>>>>>>>> used as
>>>>>>>>>>>>>>>> a prefix for existing configuration items.
>>>>>>>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
>>>>>>>>> options
>>>>>>>>>>>> need to be prefixed with `jdbc`, even they’re not related to
>>>>>>>>> Connection
>>>>>>>>>>>> properties?
>>>>>>>>>>>>>>>> This completely changes user habits — is it backward
>>>>> compatible?
>>>>>>>>>>>>>>>> In my opinion, Connection should be a model independent of
>>>>> both
>>>>>>>>>>>> Catalog and Table, and can be referenced by all
>>>>>>>>> catalog/table/udf/model
>>>>>>>>>>>> object.
>>>>>>>>>>>>>>>> It should be managed by a Component such as a
>>> ConnectionManager
>>>>>>>>> to
>>>>>>>>>>>> enable reuse. For security purposes, authentication mechanisms
>>>>> could
>>>>>>>>>>>>>>>> be supported within the ConnectionManager.
>>>>>>>>>>>>>>>> Best,
>>>>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org>
>>> 写道:
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> First of all, I think having a Connection resource is
>>>>> something
>>>>>>>>>>> that
>>>>>>>>>>>> will
>>>>>>>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
>>>>> extended
>>>>>>>>>> in
>>>>>>>>>>>> the
>>>>>>>>>>>>>>>>> future to allow for easier secret handling [1].
>>>>>>>>>>>>>>>>> In my mental mind, I'm comparing this proposal against
>>> SQL/MED
>>>>>>>>>> from
>>>>>>>>>>>> the ISO
>>>>>>>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
>>>>>>>>> friendly
>>>>>>>>>>>> syntax
>>>>>>>>>>>>>>>>> though, looking at Postgres for example [3].
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> I think it's a valid question if Connection should be
>>>>>>>>> considered
>>>>>>>>>>>> with a
>>>>>>>>>>>>>>>>> catalog or database-level scope. @Ryan can you share
>>> something
>>>>>>>>>>> more,
>>>>>>>>>>>> since
>>>>>>>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this
>>> case.
>>>>>>>>>> Which
>>>>>>>>>>>> is what
>>>>>>>>>>>>>>>>> we use internally to manage connection properties". It
>>> looks
>>>>>>>>> like
>>>>>>>>>>>> there
>>>>>>>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
>>>>>>>>>> (like,
>>>>>>>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on
>>> a
>>>>>>>>>>> database
>>>>>>>>>>>>>>>>> level).
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> Also looking forward to Leonard's input.
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> Best regards,
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> Martijn
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>>>>>>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
>>>>>>>>>>>>>>>>> [3]
>>>>>>>>>> https://www.postgresql.org/docs/current/sql-createserver.html
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <
>>> xbjtdcq@gmail.com
>>>>>> 
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>> Hey Mayank.
>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
>>>>>>>>> found
>>>>>>>>>>> some
>>>>>>>>>>>>>>>>>> issues which I think we
>>>>>>>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon
>>> boat
>>>>>>>>>>>> Festival,
>>>>>>>>>>>>>>>>>> could you kindly hold
>>>>>>>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
>>>>> discuss.
>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>> Best,
>>>>>>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <mayankjuneja27@gmail.com
>>>> 
>>>>>>>>> 写道:
>>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529
>>> [1].
>>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>>> Motivation:
>>>>>>>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
>>>>>>>>> defining
>>>>>>>>>>>> endpoints
>>>>>>>>>>>>>>>>>>> and credentials in table configuration. This approach
>>>>>>>>> prevents
>>>>>>>>>>>>>>>>>> reusability
>>>>>>>>>>>>>>>>>>> of these connections and makes table definition less
>>> secure
>>>>>>>>> by
>>>>>>>>>>>> exposing
>>>>>>>>>>>>>>>>>>> sensitive information.
>>>>>>>>>>>>>>>>>>> We propose the introduction of a new "connection"
>>> resource
>>>>> in
>>>>>>>>>>>> Flink. This
>>>>>>>>>>>>>>>>>>> will be a pluggable resource configured with a remote
>>>>>>>>> endpoint
>>>>>>>>>>> and
>>>>>>>>>>>>>>>>>>> associated access key. Once defined, connections can be
>>>>>>>>> reused
>>>>>>>>>>>> across
>>>>>>>>>>>>>>>>>> table
>>>>>>>>>>>>>>>>>>> definitions, and eventually for model definition (as
>>>>>>>>> discussed
>>>>>>>>>> in
>>>>>>>>>>>>>>>>>> FLIP-437)
>>>>>>>>>>>>>>>>>>> for inference, enabling seamless and secure integration
>>> with
>>>>>>>>>>>> external
>>>>>>>>>>>>>>>>>>> systems.
>>>>>>>>>>>>>>>>>>> The connection resource will provide a new, optional way
>>> to
>>>>>>>>>>> manage
>>>>>>>>>>>>>>>>>> external
>>>>>>>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
>>>>> definitions
>>>>>>>>>>> will
>>>>>>>>>>>> remain
>>>>>>>>>>>>>>>>>>> unchanged.
>>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>>>>> Mayank Juneja
>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> --
>>>>>>>>>>> *Mayank Juneja*
>>>>>>>>>>> Product Manager | Data Streaming and AI
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>> 
>>>>> 
>>> 
>>> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hao Li <hl...@confluent.io.INVALID>.
Sorry, I forgot to mention I also updated the FLIP to include table apis
for connection. It was originally in examples but not in the public api
section.

On Tue, Jul 29, 2025 at 10:12 AM Hao Li <hl...@confluent.io> wrote:

> Hi Leonard,
>
> Thanks for the feedback and offline sync yesterday.
>
> > I think connection is a very common need for most catalogs like
> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
> a connection.
> I added `TEMPORARY SYSTEM` connection so it's a global level connection
> which can be used for Catalog creation. After syncing with Timo, we propose
> to store it first in memory like `TEMPORARY SYSTEM FUNCTION` since this
> FLIP is already introducing lots of concepts and interfaces. We can provide
> `SYSTEM` connection and related interfaces to persist it in following up
> FLIPs.
>
> > In this case, I think reducing connector development cost is more
> important than making is explicit, the connector knows which options is
> sensitive or not.
> Sure. I updated the FLIP to merge connection options with table options so
> it's easier for current connectors.
>
> > I hope the BasicConnectionFactory can be a common one that can feed most
> common users case, otherwise encrypt all options is a good idea.
> I updated to `DefaultConnectionFactory` which handles most of the secret
> keys.
>
> Thanks,
> Hao
>
> On Mon, Jul 28, 2025 at 6:13 AM Leonard Xu <xb...@gmail.com> wrote:
>
>> Hey, Hao
>>
>> Please see my comments as follows:
>>
>> >> 2. I think we can also modify the create catalog ddl syntax.
>> >
>> > ```
>> > CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
>> > WITH (
>> >    'type' = 'jdbc'
>> > );
>> > ```
>> >
>> > Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
>> > chicken-egg problem. I think for connections to be used for catalog
>> > creation, it needs to be system connection similar to system function
>> which
>> > exist outside of CatalogManager. Maybe we can defer this to later
>> > functionality?
>>
>> I think connection is a very common need for most catalogs like
>> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
>> a connection.
>>
>>
>> >> 3. It seems the connector factory should merge the with options and
>> > connection options together and then create the source/sink. It's
>> > better that framework can merge all these options and connectors don't
>> need
>> > any codes.
>> >
>> > I think it's better to separate connections with table options and make
>> it
>> > explicit. Reasons is: the connection here should be a decrypted one.
>> It's
>> > sensitive and should be handled carefully regarding logging, usage etc.
>> > Mixing with original table options makes it hard to do. But the Flip
>> used
>> > `CatalogConnection` which is an encrypted one. I'll update it to
>> > `SensitveConnection`.
>> >> (4)Framework-level Resolution : +1 to Shengkai's point about having the
>> > framework (DynamicTableFactory) return complete options to reduce
>> connector
>> > adaptation cost.
>> >
>> > Please see my explanation for Shengkai's similar question.
>>
>> In this case, I think reducing connector development cost is more
>> important than making is explicit, the connector knows which options is
>> sensitive or not.
>>
>>
>> >> 4. Why we need to introduce ConnectionFactory? I think connection is
>> like
>> > CatalogTable. It should hold the basic information and all information
>> in
>> > the connection should be stored into secret store.
>> >
>> > The main reason is to enable user defined connection handling for
>> different
>> > types. For example, if connection type is `basic`, the corresponding
>> > factory can handle basic type secrets (e.g. extract username/password
>> from
>> > connection options and do encryption).
>> >
>> >> (2) Configurability of SECRET_FIELDS : Could the hardcoded
>> SECRET_FIELDS
>> > in BasicConnectionFactory be made configurable (e.g., 'token' vs
>> > 'accessKey') for better connector compatibility?
>> >
>> > This depends on `ConnectionFactory` implementation and can be self
>> defined
>> > by user.
>>
>> I hope the BasicConnectionFactory can be a common one that can feed most
>> common users case, otherwise encrypt all options is a good idea.
>>
>> Btw, I also want to push the FLIP forward and start a vote ASAP, thus a
>> meeting is welcome if you think it can help finalizing the discussion
>> thread.
>>
>>
>> Best,
>> Leonard
>>
>>
>>
>> >
>> >> Hi friends
>> >>
>> >> I like the updated FLIP goals, that’s what I want. I’ve some feedback:
>> >>
>> >> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
>> >> SecretStore?
>> >> (2) Configurability of SECRET_FIELDS : Could the hardcoded
>> SECRET_FIELDS
>> >> in BasicConnectionFactory be made configurable (e.g., 'token' vs
>> >> 'accessKey') for better connector compatibility?
>> >> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
>> returns
>> >> SensitiveConnection, while BasicConnectionFactory#resolveConnection
>> returns
>> >> Map<String, String>. Should these be aligned?
>> >> (4)Framework-level Resolution : +1 to Shengkai's point about having the
>> >> framework (DynamicTableFactory) return complete options to reduce
>> connector
>> >> adaptation cost.
>> >> (5)Secret ID Handling : When no encryption is needed, secretId is null
>> >> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)).
>> This
>> >> behavior should be explicitly documented in the interfaces.
>> >>
>> >> Best,
>> >> Leonard
>> >>
>> >>> 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
>> >>>
>> >>> hi.
>> >>>
>> >>> Sorry for the late reply. I just have some questions:
>> >>>
>> >>> 1. Why SecretStoreFactory#open throws a CatalogException? I think the
>> >>> exteranl system can not handle this exception.
>> >>>
>> >>> 2. I think we can also modify the create catalog ddl syntax.
>> >>>
>> >>> ```
>> >>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
>> >>> WITH (
>> >>>   'type' = 'jdbc'
>> >>> );
>> >>> ```
>> >>>
>> >>> 3. It seems the connector factory should merge the with options and
>> >>> connection options together and then create the source/sink. It's
>> >>> better that framework can merge all these options and connectors don't
>> >> need
>> >>> any codes.
>> >>>
>> >>> 4. Why we need to introduce ConnectionFactory? I think connection is
>> like
>> >>> CatalogTable. It should hold the basic information and all
>> information in
>> >>> the connection should be stored into secret store.
>> >>>
>> >>>
>> >>> Best,
>> >>> Shengkai
>> >>>
>> >>>
>> >>> Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
>> >>>
>> >>>> Hi Mayank,
>> >>>>
>> >>>> Thanks for updating the FLIP and clearly documenting our discussion.
>> >>>>
>> >>>> +1 for moving forward with the vote, unless there are objections from
>> >>>> others.
>> >>>>
>> >>>> Cheers,
>> >>>> Timo
>> >>>>
>> >>>> On 22.07.25 02:14, Mayank Juneja wrote:
>> >>>>> Hi Ryan and Austin,
>> >>>>>
>> >>>>> Thanks for your suggestions. I've updated the FLIP with the
>> following
>> >>>>> additional info -
>> >>>>>
>> >>>>> 1. *table.secret-store.kind* key to register the SecretStore in a
>> yaml
>> >>>> file
>> >>>>> 2. *updateSecret* method in WritableSecretStore interface
>> >>>>>
>> >>>>> Thanks,
>> >>>>> Mayank
>> >>>>>
>> >>>>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
>> >>>>> austin.cawley@gmail.com> wrote:
>> >>>>>
>> >>>>>> Hey all,
>> >>>>>>
>> >>>>>> Thanks for the nice flip all! I’m just reading through – had one
>> >>>> question
>> >>>>>> on the ALTER CONNECTION implementation flow. Would it make sense
>> for
>> >> the
>> >>>>>> WritableSecretStore to expose a method for updating a secret by
>> ID, so
>> >>>> it
>> >>>>>> can be done atomically? Else, would we need to call delete and
>> create
>> >>>>>> again, potentially introducing concurrent resolution errors?
>> >>>>>>
>> >>>>>> Best,
>> >>>>>> Austin
>> >>>>>>
>> >>>>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
>> >>>>>> <ry...@shopify.com.invalid> wrote:
>> >>>>>>
>> >>>>>>> Hi Mayank,
>> >>>>>>>
>> >>>>>>> Thanks for updating the FLIP. Overall it looks good to me.
>> >>>>>>>
>> >>>>>>> One question I had related to how someone could choose the
>> >> SecretStore
>> >>>>>> they
>> >>>>>>> want to use if they use something like the SQL Gateway as the
>> >>>> entrypoint
>> >>>>>> on
>> >>>>>>> top of a remote Session cluster. I don't see an explicit way to
>> set
>> >> the
>> >>>>>>> SecretStore in the FLIP.
>> >>>>>>> I assume we'll do it similar to the CatalogStore but I wanted to
>> call
>> >>>>>> this
>> >>>>>>> out.
>> >>>>>>>
>> >>>>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
>> >>>>>>> file:///path/to/catalog/store/
>> >>>>>>>
>> >>>>>>> Ryan van Huuksloot
>> >>>>>>> Staff Engineer, Infrastructure | Streaming Platform
>> >>>>>>> [image: Shopify]
>> >>>>>>> <
>> >>>>
>> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
>> >>>>>>>
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
>> >>>> mayankjuneja27@gmail.com>
>> >>>>>>> wrote:
>> >>>>>>>
>> >>>>>>>> Hi everyone,
>> >>>>>>>>
>> >>>>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
>> >>>> ideas
>> >>>>>>>> proposed earlier in the thread. Looking forward to your feedback.
>> >>>>>>>> https://cwiki.apache.org/confluence/x/cYroF
>> >>>>>>>>
>> >>>>>>>> Best,
>> >>>>>>>> Mayank
>> >>>>>>>>
>> >>>>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
>> >> wrote:
>> >>>>>>>>
>> >>>>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The
>> >> new
>> >>>>>>>>> proposal looks well, +1 from my side.
>> >>>>>>>>>
>> >>>>>>>>> Could you draft(update) current FLIP docs thus we can have some
>> >>>>>>> specific
>> >>>>>>>>> discussions later?
>> >>>>>>>>>
>> >>>>>>>>>
>> >>>>>>>>> Best,
>> >>>>>>>>> Leonard
>> >>>>>>>>>
>> >>>>>>>>>
>> >>>>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
>> >>>>>>>>>>
>> >>>>>>>>>> Hi everyone,
>> >>>>>>>>>>
>> >>>>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank,
>> Hao
>> >>>>>>> and
>> >>>>>>>> I
>> >>>>>>>>> synced offline and came up we an improved proposal. Before we
>> >> update
>> >>>>>>> the
>> >>>>>>>>> FLIP let me summarize the most important key facts that
>> hopefully
>> >>>>>>> address
>> >>>>>>>>> most concerns:
>> >>>>>>>>>>
>> >>>>>>>>>> 1) SecretStore
>> >>>>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
>> >>>>>> highest
>> >>>>>>>>> level in TableEnvironment.
>> >>>>>>>>>> - SecretStore is initialized with options and potentially
>> >>>>>> environment
>> >>>>>>>>> variables. Including
>> >>>>>> EnvironmentSettings.withSecretStore(SecretStore).
>> >>>>>>>>>> - The SecretStore is pluggable and discovered using the regular
>> >>>>>>>>> factory-approach.
>> >>>>>>>>>> - For example, it could implement Azure Key Vault or other
>> cloud
>> >>>>>>>>> provider secrets stores.
>> >>>>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
>> >> sensitive
>> >>>>>>>> data.
>> >>>>>>>>>>
>> >>>>>>>>>> 2) Connections
>> >>>>>>>>>> - Connections are catalog objects identified with 3-part
>> >>>>>> identifiers.
>> >>>>>>>>> 3-part identifiers are crucial for managability of larger
>> projects
>> >>>>>> and
>> >>>>>>>>> align with existing catalog objects.
>> >>>>>>>>>> - They contain connection details, e.g. URL, query parameters,
>> and
>> >>>>>>>> other
>> >>>>>>>>> configuration.
>> >>>>>>>>>> - They do not contain secrets, but only pointers to secrets in
>> the
>> >>>>>>>>> SecretStore.
>> >>>>>>>>>>
>> >>>>>>>>>> 3) Connection DDL
>> >>>>>>>>>>
>> >>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>> >>>>>>>>>> 'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>> >>>>>>>>>> ...
>> >>>>>>>>>> )
>> >>>>>>>>>>
>> >>>>>>>>>> - Connection type is pluggable and discovered using the regular
>> >>>>>>>>> factory-approach.
>> >>>>>>>>>> - The factory extracts secrets and puts them into SecretStore.
>> >>>>>>>>>> - The factory only leaves non-confidential options left that
>> can
>> >> be
>> >>>>>>>>> stored in a catalog.
>> >>>>>>>>>>
>> >>>>>>>>>> When executing:
>> >>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>> >>>>>>>>>> 'type' = 'basic',
>> >>>>>>>>>> 'url' = 'api.example.com',
>> >>>>>>>>>> 'username' = 'bob',
>> >>>>>>>>>> 'password' = 'xyz'
>> >>>>>>>>>> )
>> >>>>>>>>>>
>> >>>>>>>>>> The catalog will receive something similar to:
>> >>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>> >>>>>>>>>> 'type' = 'basic',
>> >>>>>>>>>> 'url' = 'api.example.com',
>> >>>>>>>>>> 'secret.store' = 'azure-key-vault'
>> >>>>>>>>>> 'secret.id' = 'secretId'
>> >>>>>>>>>> )
>> >>>>>>>>>>
>> >>>>>>>>>> - However, the exact property design is up to the connection
>> >>>>>> factory.
>> >>>>>>>>>>
>> >>>>>>>>>> 4) Connection Usage
>> >>>>>>>>>>
>> >>>>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
>> >>>>>>>>>>
>> >>>>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION
>> keyword
>> >>>>>>>>> similar to BigQuery.
>> >>>>>>>>>> - The connection will be provided in a table/model
>> >>>>>> provider/function
>> >>>>>>>>> definition factory.
>> >>>>>>>>>>
>> >>>>>>>>>> 5) CatalogStore / Catalog Initialization
>> >>>>>>>>>>
>> >>>>>>>>>> Catalog store or catalog can make use of SecretStore to
>> retrieve
>> >>>>>>>> initial
>> >>>>>>>>> credentials for bootstrapping. All objects lower then catalog
>> >>>>>>>> store/catalog
>> >>>>>>>>> can then use connections. If you think we still need system
>> level
>> >>>>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
>> >> WITH
>> >>>>>>> (..)
>> >>>>>>>>> similar to SYSTEM functions directly store in a
>> ConnectioManager in
>> >>>>>>>>> TableEnvironment. But for now I would suggest to start simple
>> with
>> >>>>>>>>> per-catalog connections and later evolve the design.
>> >>>>>>>>>>
>> >>>>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly
>> not
>> >>>>>> an
>> >>>>>>>>> expert on it. This is why we should try to push the problem to
>> >>>>>> existing
>> >>>>>>>>> solutions and don't start storing secrets in Flink in any way.
>> >> Thus,
>> >>>>>>> the
>> >>>>>>>>> interfaces will be defined very generic.
>> >>>>>>>>>>
>> >>>>>>>>>> Looking forward to your feedback.
>> >>>>>>>>>>
>> >>>>>>>>>> Cheers,
>> >>>>>>>>>> Timo
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
>> >>>>>>>>>>> Thanks  Timo for joining this thread.
>> >>>>>>>>>>> I agree that this feature is needed by the community; the
>> current
>> >>>>>>>>> disagreement is only about the implementation method or
>> solution.
>> >>>>>>>>>>> Your thoughts looks generally good to me, looking forward to
>> your
>> >>>>>>>>> proposal.
>> >>>>>>>>>>> Best,
>> >>>>>>>>>>> Leonard
>> >>>>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Hi everyone,
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> thanks for this healthy discussion. Looking at high number of
>> >>>>>>>>> participants, it looks like we definitely want this feature. We
>> >> just
>> >>>>>>> need
>> >>>>>>>>> to figure out the "how".
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> This reminds me very much of the discussion we had for CREATE
>> >>>>>>>>> FUNCTION. There, we discussed whether functions should be named
>> >>>>>>> globally
>> >>>>>>>> or
>> >>>>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
>> >>>>>>>> FUNCTION`
>> >>>>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team
>> of an
>> >>>>>>>>> organization (which might provide system functions) and
>> individual
>> >>>>>> data
>> >>>>>>>>> teams or use cases (scoped by catalog/database).
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Looking at other modern vendors like Snowflake there is
>> SECRET
>> >>>>>>>> (scoped
>> >>>>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So
>> also
>> >>>>>>> other
>> >>>>>>>>> vendors offer global and per-team / per-use case connections
>> >> details.
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> In general, I think fitting connections into the existing
>> >>>>>> concepts
>> >>>>>>>> for
>> >>>>>>>>> catalog objects (with three-part identifier) makes managing them
>> >>>>>>> easier.
>> >>>>>>>>> But I also see the need for global defaults.
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Btw keep in mind that a catalog implementation should only
>> store
>> >>>>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
>> >> data, a
>> >>>>>>>>> CatalogConnection should not store the credentials. It should
>> only
>> >>>>>>> offer
>> >>>>>>>> a
>> >>>>>>>>> factory that allows for storing and retrieving them. In real
>> world
>> >>>>>>>>> scenarios a factory is most likely backed by a product like
>> Azure
>> >> Key
>> >>>>>>>> Vault.
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> So code-wise having a ConnectionManager that behaves similar
>> to
>> >>>>>>>>> FunctionManager sounds reasonable.
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> +1 for having special syntax instead of using properties.
>> This
>> >>>>>>> allows
>> >>>>>>>>> to access connections in tables, models, functions. And
>> catalogs,
>> >> if
>> >>>>>> we
>> >>>>>>>>> agree to have global ones as well.
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> What do you think?
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Let me spend some more thoughts on this and come back with a
>> >>>>>>> concrete
>> >>>>>>>>> proposal by early next week.
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> Cheers,
>> >>>>>>>>>>>> Timo
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> [1]
>> >>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
>> >>>>>>>>>>>> [2]
>> >>>>>>>>>
>> >>>>>>
>> >> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>> >>>>>>>>>>>>
>> >>>>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
>> >>>>>>>>>>>>> Hey,Mayank
>> >>>>>>>>>>>>> Please see my feedback as following:
>> >>>>>>>>>>>>> 1. One of the motivations of this FLIP is to improve
>> security.
>> >>>>>>>>> However, the current design stores all connection information in
>> >> the
>> >>>>>>>>> catalog,
>> >>>>>>>>>>>>> and each Flink SQL job reads from the catalog during
>> >>>>>> compilation.
>> >>>>>>>> The
>> >>>>>>>>> connection information is passed between SQL Gateway and the
>> >>>>>>>>>>>>> catalog in plaintext, which actually introduces new security
>> >>>>>>> risks.
>> >>>>>>>>>>>>> 2. The name "Connection" should be changed to something like
>> >>>>>>>>> ConnectionSpec to clearly indicate that it is a object
>> containing
>> >>>>>> only
>> >>>>>>>>> static
>> >>>>>>>>>>>>> properties without a lifecycle. Putting aside the naming
>> issue,
>> >>>>>> I
>> >>>>>>>>> think the current model and hierarchy design is somewhat
>> strange.
>> >>>>>>> Storing
>> >>>>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the
>> same
>> >>>>>>>> Catalog
>> >>>>>>>>> with hierarchical identifiers like
>> >>>>>> catalog-name.db-name.connection-name
>> >>>>>>>>>>>>> raises the following questions:
>> >>>>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
>> >>>>>>> Connection
>> >>>>>>>>> object ?
>> >>>>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
>> >>>>>> can't
>> >>>>>>> we
>> >>>>>>>>> use a Connection to create a MySQL Catalog?
>> >>>>>>>>>>>>> 3. Regarding the connector usage examples given in this
>> FLIP:
>> >>>>>>>>>>>>> ```sql
>> >>>>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
>> >>>>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>> >>>>>>>>>>>>> 3  WITH (
>> >>>>>>>>>>>>> 4    'type' = 'jdbc',
>> >>>>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
>> >>>>>>>>> customer-db.example.com:3306/customerdb',
>> >>>>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>> >>>>>>>>>>>>> 7  );
>> >>>>>>>>>>>>> 8
>> >>>>>>>>>>>>> 9  CREATE TABLE customers (
>> >>>>>>>>>>>>> 10   customer_id INT,
>> >>>>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>> >>>>>>>>>>>>> 12 ) WITH (
>> >>>>>>>>>>>>> 13   'connector' = 'jdbc',
>> >>>>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
>> >>>>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>> >>>>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>> >>>>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
>> >>>>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>> >>>>>>>>>>>>> 19 );
>> >>>>>>>>>>>>> ```
>> >>>>>>>>>>>>> I see three issues from SQL semantics and Connector
>> >>>>>> compatibility
>> >>>>>>>>> perspectives:
>> >>>>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
>> >> identifier
>> >>>>>>> of
>> >>>>>>>> a
>> >>>>>>>>> CONNECTION defined in SQL. However, this identifier is
>> referenced
>> >>>>>>>>>>>>>    via a string value inside the table’s WITH clause, which
>> >>>>>> feel
>> >>>>>>>>> hack for me.
>> >>>>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
>> >>>>>>>>> `jdbc.connection` will confuse users because `connection.xx`
>> maybe
>> >>>>>>>> already
>> >>>>>>>>> used as
>> >>>>>>>>>>>>> a prefix for existing configuration items.
>> >>>>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
>> >>>>>> options
>> >>>>>>>>> need to be prefixed with `jdbc`, even they’re not related to
>> >>>>>> Connection
>> >>>>>>>>> properties?
>> >>>>>>>>>>>>> This completely changes user habits — is it backward
>> >> compatible?
>> >>>>>>>>>>>>> In my opinion, Connection should be a model independent of
>> >> both
>> >>>>>>>>> Catalog and Table, and can be referenced by all
>> >>>>>> catalog/table/udf/model
>> >>>>>>>>> object.
>> >>>>>>>>>>>>> It should be managed by a Component such as a
>> ConnectionManager
>> >>>>>> to
>> >>>>>>>>> enable reuse. For security purposes, authentication mechanisms
>> >> could
>> >>>>>>>>>>>>> be supported within the ConnectionManager.
>> >>>>>>>>>>>>> Best,
>> >>>>>>>>>>>>> Leonard
>> >>>>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org>
>> 写道:
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> Hi all,
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> First of all, I think having a Connection resource is
>> >> something
>> >>>>>>>> that
>> >>>>>>>>> will
>> >>>>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
>> >> extended
>> >>>>>>> in
>> >>>>>>>>> the
>> >>>>>>>>>>>>>> future to allow for easier secret handling [1].
>> >>>>>>>>>>>>>> In my mental mind, I'm comparing this proposal against
>> SQL/MED
>> >>>>>>> from
>> >>>>>>>>> the ISO
>> >>>>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
>> >>>>>> friendly
>> >>>>>>>>> syntax
>> >>>>>>>>>>>>>> though, looking at Postgres for example [3].
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> I think it's a valid question if Connection should be
>> >>>>>> considered
>> >>>>>>>>> with a
>> >>>>>>>>>>>>>> catalog or database-level scope. @Ryan can you share
>> something
>> >>>>>>>> more,
>> >>>>>>>>> since
>> >>>>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this
>> case.
>> >>>>>>> Which
>> >>>>>>>>> is what
>> >>>>>>>>>>>>>> we use internally to manage connection properties". It
>> looks
>> >>>>>> like
>> >>>>>>>>> there
>> >>>>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
>> >>>>>>> (like,
>> >>>>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on
>> a
>> >>>>>>>> database
>> >>>>>>>>>>>>>> level).
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> Also looking forward to Leonard's input.
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> Best regards,
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> Martijn
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>> >>>>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
>> >>>>>>>>>>>>>> [3]
>> >>>>>>> https://www.postgresql.org/docs/current/sql-createserver.html
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <
>> xbjtdcq@gmail.com
>> >>>
>> >>>>>>>>> wrote:
>> >>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> Hey Mayank.
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
>> >>>>>> found
>> >>>>>>>> some
>> >>>>>>>>>>>>>>> issues which I think we
>> >>>>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon
>> boat
>> >>>>>>>>> Festival,
>> >>>>>>>>>>>>>>> could you kindly hold
>> >>>>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
>> >> discuss.
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>> Best,
>> >>>>>>>>>>>>>>> Leonard
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <mayankjuneja27@gmail.com
>> >
>> >>>>>> 写道:
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> Hi all,
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529
>> [1].
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> Motivation:
>> >>>>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
>> >>>>>> defining
>> >>>>>>>>> endpoints
>> >>>>>>>>>>>>>>>> and credentials in table configuration. This approach
>> >>>>>> prevents
>> >>>>>>>>>>>>>>> reusability
>> >>>>>>>>>>>>>>>> of these connections and makes table definition less
>> secure
>> >>>>>> by
>> >>>>>>>>> exposing
>> >>>>>>>>>>>>>>>> sensitive information.
>> >>>>>>>>>>>>>>>> We propose the introduction of a new "connection"
>> resource
>> >> in
>> >>>>>>>>> Flink. This
>> >>>>>>>>>>>>>>>> will be a pluggable resource configured with a remote
>> >>>>>> endpoint
>> >>>>>>>> and
>> >>>>>>>>>>>>>>>> associated access key. Once defined, connections can be
>> >>>>>> reused
>> >>>>>>>>> across
>> >>>>>>>>>>>>>>> table
>> >>>>>>>>>>>>>>>> definitions, and eventually for model definition (as
>> >>>>>> discussed
>> >>>>>>> in
>> >>>>>>>>>>>>>>> FLIP-437)
>> >>>>>>>>>>>>>>>> for inference, enabling seamless and secure integration
>> with
>> >>>>>>>>> external
>> >>>>>>>>>>>>>>>> systems.
>> >>>>>>>>>>>>>>>> The connection resource will provide a new, optional way
>> to
>> >>>>>>>> manage
>> >>>>>>>>>>>>>>> external
>> >>>>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
>> >> definitions
>> >>>>>>>> will
>> >>>>>>>>> remain
>> >>>>>>>>>>>>>>>> unchanged.
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>> >>>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>> Best Regards,
>> >>>>>>>>>>>>>>>> Mayank Juneja
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>>>>
>> >>>>>>>>>>>>
>> >>>>>>>>>>
>> >>>>>>>>>
>> >>>>>>>>>
>> >>>>>>>>
>> >>>>>>>> --
>> >>>>>>>> *Mayank Juneja*
>> >>>>>>>> Product Manager | Data Streaming and AI
>> >>>>>>>>
>> >>>>>>>
>> >>>>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>
>> >>
>>
>>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hao Li <hl...@confluent.io.INVALID>.
Hi Leonard,

Thanks for the feedback and offline sync yesterday.

> I think connection is a very common need for most catalogs like
MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
a connection.
I added `TEMPORARY SYSTEM` connection so it's a global level connection
which can be used for Catalog creation. After syncing with Timo, we propose
to store it first in memory like `TEMPORARY SYSTEM FUNCTION` since this
FLIP is already introducing lots of concepts and interfaces. We can provide
`SYSTEM` connection and related interfaces to persist it in following up
FLIPs.

> In this case, I think reducing connector development cost is more
important than making is explicit, the connector knows which options is
sensitive or not.
Sure. I updated the FLIP to merge connection options with table options so
it's easier for current connectors.

> I hope the BasicConnectionFactory can be a common one that can feed most
common users case, otherwise encrypt all options is a good idea.
I updated to `DefaultConnectionFactory` which handles most of the secret
keys.

Thanks,
Hao

On Mon, Jul 28, 2025 at 6:13 AM Leonard Xu <xb...@gmail.com> wrote:

> Hey, Hao
>
> Please see my comments as follows:
>
> >> 2. I think we can also modify the create catalog ddl syntax.
> >
> > ```
> > CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> > WITH (
> >    'type' = 'jdbc'
> > );
> > ```
> >
> > Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
> > chicken-egg problem. I think for connections to be used for catalog
> > creation, it needs to be system connection similar to system function
> which
> > exist outside of CatalogManager. Maybe we can defer this to later
> > functionality?
>
> I think connection is a very common need for most catalogs like
> MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need
> a connection.
>
>
> >> 3. It seems the connector factory should merge the with options and
> > connection options together and then create the source/sink. It's
> > better that framework can merge all these options and connectors don't
> need
> > any codes.
> >
> > I think it's better to separate connections with table options and make
> it
> > explicit. Reasons is: the connection here should be a decrypted one. It's
> > sensitive and should be handled carefully regarding logging, usage etc.
> > Mixing with original table options makes it hard to do. But the Flip used
> > `CatalogConnection` which is an encrypted one. I'll update it to
> > `SensitveConnection`.
> >> (4)Framework-level Resolution : +1 to Shengkai's point about having the
> > framework (DynamicTableFactory) return complete options to reduce
> connector
> > adaptation cost.
> >
> > Please see my explanation for Shengkai's similar question.
>
> In this case, I think reducing connector development cost is more
> important than making is explicit, the connector knows which options is
> sensitive or not.
>
>
> >> 4. Why we need to introduce ConnectionFactory? I think connection is
> like
> > CatalogTable. It should hold the basic information and all information in
> > the connection should be stored into secret store.
> >
> > The main reason is to enable user defined connection handling for
> different
> > types. For example, if connection type is `basic`, the corresponding
> > factory can handle basic type secrets (e.g. extract username/password
> from
> > connection options and do encryption).
> >
> >> (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
> > in BasicConnectionFactory be made configurable (e.g., 'token' vs
> > 'accessKey') for better connector compatibility?
> >
> > This depends on `ConnectionFactory` implementation and can be self
> defined
> > by user.
>
> I hope the BasicConnectionFactory can be a common one that can feed most
> common users case, otherwise encrypt all options is a good idea.
>
> Btw, I also want to push the FLIP forward and start a vote ASAP, thus a
> meeting is welcome if you think it can help finalizing the discussion
> thread.
>
>
> Best,
> Leonard
>
>
>
> >
> >> Hi friends
> >>
> >> I like the updated FLIP goals, that’s what I want. I’ve some feedback:
> >>
> >> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
> >> SecretStore?
> >> (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
> >> in BasicConnectionFactory be made configurable (e.g., 'token' vs
> >> 'accessKey') for better connector compatibility?
> >> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
> returns
> >> SensitiveConnection, while BasicConnectionFactory#resolveConnection
> returns
> >> Map<String, String>. Should these be aligned?
> >> (4)Framework-level Resolution : +1 to Shengkai's point about having the
> >> framework (DynamicTableFactory) return complete options to reduce
> connector
> >> adaptation cost.
> >> (5)Secret ID Handling : When no encryption is needed, secretId is null
> >> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This
> >> behavior should be explicitly documented in the interfaces.
> >>
> >> Best,
> >> Leonard
> >>
> >>> 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
> >>>
> >>> hi.
> >>>
> >>> Sorry for the late reply. I just have some questions:
> >>>
> >>> 1. Why SecretStoreFactory#open throws a CatalogException? I think the
> >>> exteranl system can not handle this exception.
> >>>
> >>> 2. I think we can also modify the create catalog ddl syntax.
> >>>
> >>> ```
> >>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> >>> WITH (
> >>>   'type' = 'jdbc'
> >>> );
> >>> ```
> >>>
> >>> 3. It seems the connector factory should merge the with options and
> >>> connection options together and then create the source/sink. It's
> >>> better that framework can merge all these options and connectors don't
> >> need
> >>> any codes.
> >>>
> >>> 4. Why we need to introduce ConnectionFactory? I think connection is
> like
> >>> CatalogTable. It should hold the basic information and all information
> in
> >>> the connection should be stored into secret store.
> >>>
> >>>
> >>> Best,
> >>> Shengkai
> >>>
> >>>
> >>> Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
> >>>
> >>>> Hi Mayank,
> >>>>
> >>>> Thanks for updating the FLIP and clearly documenting our discussion.
> >>>>
> >>>> +1 for moving forward with the vote, unless there are objections from
> >>>> others.
> >>>>
> >>>> Cheers,
> >>>> Timo
> >>>>
> >>>> On 22.07.25 02:14, Mayank Juneja wrote:
> >>>>> Hi Ryan and Austin,
> >>>>>
> >>>>> Thanks for your suggestions. I've updated the FLIP with the following
> >>>>> additional info -
> >>>>>
> >>>>> 1. *table.secret-store.kind* key to register the SecretStore in a
> yaml
> >>>> file
> >>>>> 2. *updateSecret* method in WritableSecretStore interface
> >>>>>
> >>>>> Thanks,
> >>>>> Mayank
> >>>>>
> >>>>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
> >>>>> austin.cawley@gmail.com> wrote:
> >>>>>
> >>>>>> Hey all,
> >>>>>>
> >>>>>> Thanks for the nice flip all! I’m just reading through – had one
> >>>> question
> >>>>>> on the ALTER CONNECTION implementation flow. Would it make sense for
> >> the
> >>>>>> WritableSecretStore to expose a method for updating a secret by ID,
> so
> >>>> it
> >>>>>> can be done atomically? Else, would we need to call delete and
> create
> >>>>>> again, potentially introducing concurrent resolution errors?
> >>>>>>
> >>>>>> Best,
> >>>>>> Austin
> >>>>>>
> >>>>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
> >>>>>> <ry...@shopify.com.invalid> wrote:
> >>>>>>
> >>>>>>> Hi Mayank,
> >>>>>>>
> >>>>>>> Thanks for updating the FLIP. Overall it looks good to me.
> >>>>>>>
> >>>>>>> One question I had related to how someone could choose the
> >> SecretStore
> >>>>>> they
> >>>>>>> want to use if they use something like the SQL Gateway as the
> >>>> entrypoint
> >>>>>> on
> >>>>>>> top of a remote Session cluster. I don't see an explicit way to set
> >> the
> >>>>>>> SecretStore in the FLIP.
> >>>>>>> I assume we'll do it similar to the CatalogStore but I wanted to
> call
> >>>>>> this
> >>>>>>> out.
> >>>>>>>
> >>>>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
> >>>>>>> file:///path/to/catalog/store/
> >>>>>>>
> >>>>>>> Ryan van Huuksloot
> >>>>>>> Staff Engineer, Infrastructure | Streaming Platform
> >>>>>>> [image: Shopify]
> >>>>>>> <
> >>>>
> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
> >>>> mayankjuneja27@gmail.com>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>> Hi everyone,
> >>>>>>>>
> >>>>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
> >>>> ideas
> >>>>>>>> proposed earlier in the thread. Looking forward to your feedback.
> >>>>>>>> https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>>>
> >>>>>>>> Best,
> >>>>>>>> Mayank
> >>>>>>>>
> >>>>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
> >> wrote:
> >>>>>>>>
> >>>>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The
> >> new
> >>>>>>>>> proposal looks well, +1 from my side.
> >>>>>>>>>
> >>>>>>>>> Could you draft(update) current FLIP docs thus we can have some
> >>>>>>> specific
> >>>>>>>>> discussions later?
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Best,
> >>>>>>>>> Leonard
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> >>>>>>>>>>
> >>>>>>>>>> Hi everyone,
> >>>>>>>>>>
> >>>>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank,
> Hao
> >>>>>>> and
> >>>>>>>> I
> >>>>>>>>> synced offline and came up we an improved proposal. Before we
> >> update
> >>>>>>> the
> >>>>>>>>> FLIP let me summarize the most important key facts that hopefully
> >>>>>>> address
> >>>>>>>>> most concerns:
> >>>>>>>>>>
> >>>>>>>>>> 1) SecretStore
> >>>>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
> >>>>>> highest
> >>>>>>>>> level in TableEnvironment.
> >>>>>>>>>> - SecretStore is initialized with options and potentially
> >>>>>> environment
> >>>>>>>>> variables. Including
> >>>>>> EnvironmentSettings.withSecretStore(SecretStore).
> >>>>>>>>>> - The SecretStore is pluggable and discovered using the regular
> >>>>>>>>> factory-approach.
> >>>>>>>>>> - For example, it could implement Azure Key Vault or other cloud
> >>>>>>>>> provider secrets stores.
> >>>>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
> >> sensitive
> >>>>>>>> data.
> >>>>>>>>>>
> >>>>>>>>>> 2) Connections
> >>>>>>>>>> - Connections are catalog objects identified with 3-part
> >>>>>> identifiers.
> >>>>>>>>> 3-part identifiers are crucial for managability of larger
> projects
> >>>>>> and
> >>>>>>>>> align with existing catalog objects.
> >>>>>>>>>> - They contain connection details, e.g. URL, query parameters,
> and
> >>>>>>>> other
> >>>>>>>>> configuration.
> >>>>>>>>>> - They do not contain secrets, but only pointers to secrets in
> the
> >>>>>>>>> SecretStore.
> >>>>>>>>>>
> >>>>>>>>>> 3) Connection DDL
> >>>>>>>>>>
> >>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>>> 'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> >>>>>>>>>> ...
> >>>>>>>>>> )
> >>>>>>>>>>
> >>>>>>>>>> - Connection type is pluggable and discovered using the regular
> >>>>>>>>> factory-approach.
> >>>>>>>>>> - The factory extracts secrets and puts them into SecretStore.
> >>>>>>>>>> - The factory only leaves non-confidential options left that can
> >> be
> >>>>>>>>> stored in a catalog.
> >>>>>>>>>>
> >>>>>>>>>> When executing:
> >>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>>> 'type' = 'basic',
> >>>>>>>>>> 'url' = 'api.example.com',
> >>>>>>>>>> 'username' = 'bob',
> >>>>>>>>>> 'password' = 'xyz'
> >>>>>>>>>> )
> >>>>>>>>>>
> >>>>>>>>>> The catalog will receive something similar to:
> >>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>>> 'type' = 'basic',
> >>>>>>>>>> 'url' = 'api.example.com',
> >>>>>>>>>> 'secret.store' = 'azure-key-vault'
> >>>>>>>>>> 'secret.id' = 'secretId'
> >>>>>>>>>> )
> >>>>>>>>>>
> >>>>>>>>>> - However, the exact property design is up to the connection
> >>>>>> factory.
> >>>>>>>>>>
> >>>>>>>>>> 4) Connection Usage
> >>>>>>>>>>
> >>>>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> >>>>>>>>>>
> >>>>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION
> keyword
> >>>>>>>>> similar to BigQuery.
> >>>>>>>>>> - The connection will be provided in a table/model
> >>>>>> provider/function
> >>>>>>>>> definition factory.
> >>>>>>>>>>
> >>>>>>>>>> 5) CatalogStore / Catalog Initialization
> >>>>>>>>>>
> >>>>>>>>>> Catalog store or catalog can make use of SecretStore to retrieve
> >>>>>>>> initial
> >>>>>>>>> credentials for bootstrapping. All objects lower then catalog
> >>>>>>>> store/catalog
> >>>>>>>>> can then use connections. If you think we still need system level
> >>>>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
> >> WITH
> >>>>>>> (..)
> >>>>>>>>> similar to SYSTEM functions directly store in a ConnectioManager
> in
> >>>>>>>>> TableEnvironment. But for now I would suggest to start simple
> with
> >>>>>>>>> per-catalog connections and later evolve the design.
> >>>>>>>>>>
> >>>>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly
> not
> >>>>>> an
> >>>>>>>>> expert on it. This is why we should try to push the problem to
> >>>>>> existing
> >>>>>>>>> solutions and don't start storing secrets in Flink in any way.
> >> Thus,
> >>>>>>> the
> >>>>>>>>> interfaces will be defined very generic.
> >>>>>>>>>>
> >>>>>>>>>> Looking forward to your feedback.
> >>>>>>>>>>
> >>>>>>>>>> Cheers,
> >>>>>>>>>> Timo
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
> >>>>>>>>>>> Thanks  Timo for joining this thread.
> >>>>>>>>>>> I agree that this feature is needed by the community; the
> current
> >>>>>>>>> disagreement is only about the implementation method or solution.
> >>>>>>>>>>> Your thoughts looks generally good to me, looking forward to
> your
> >>>>>>>>> proposal.
> >>>>>>>>>>> Best,
> >>>>>>>>>>> Leonard
> >>>>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> >>>>>>>>>>>>
> >>>>>>>>>>>> Hi everyone,
> >>>>>>>>>>>>
> >>>>>>>>>>>> thanks for this healthy discussion. Looking at high number of
> >>>>>>>>> participants, it looks like we definitely want this feature. We
> >> just
> >>>>>>> need
> >>>>>>>>> to figure out the "how".
> >>>>>>>>>>>>
> >>>>>>>>>>>> This reminds me very much of the discussion we had for CREATE
> >>>>>>>>> FUNCTION. There, we discussed whether functions should be named
> >>>>>>> globally
> >>>>>>>> or
> >>>>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
> >>>>>>>> FUNCTION`
> >>>>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team of
> an
> >>>>>>>>> organization (which might provide system functions) and
> individual
> >>>>>> data
> >>>>>>>>> teams or use cases (scoped by catalog/database).
> >>>>>>>>>>>>
> >>>>>>>>>>>> Looking at other modern vendors like Snowflake there is SECRET
> >>>>>>>> (scoped
> >>>>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So
> also
> >>>>>>> other
> >>>>>>>>> vendors offer global and per-team / per-use case connections
> >> details.
> >>>>>>>>>>>>
> >>>>>>>>>>>> In general, I think fitting connections into the existing
> >>>>>> concepts
> >>>>>>>> for
> >>>>>>>>> catalog objects (with three-part identifier) makes managing them
> >>>>>>> easier.
> >>>>>>>>> But I also see the need for global defaults.
> >>>>>>>>>>>>
> >>>>>>>>>>>> Btw keep in mind that a catalog implementation should only
> store
> >>>>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
> >> data, a
> >>>>>>>>> CatalogConnection should not store the credentials. It should
> only
> >>>>>>> offer
> >>>>>>>> a
> >>>>>>>>> factory that allows for storing and retrieving them. In real
> world
> >>>>>>>>> scenarios a factory is most likely backed by a product like Azure
> >> Key
> >>>>>>>> Vault.
> >>>>>>>>>>>>
> >>>>>>>>>>>> So code-wise having a ConnectionManager that behaves similar
> to
> >>>>>>>>> FunctionManager sounds reasonable.
> >>>>>>>>>>>>
> >>>>>>>>>>>> +1 for having special syntax instead of using properties. This
> >>>>>>> allows
> >>>>>>>>> to access connections in tables, models, functions. And catalogs,
> >> if
> >>>>>> we
> >>>>>>>>> agree to have global ones as well.
> >>>>>>>>>>>>
> >>>>>>>>>>>> What do you think?
> >>>>>>>>>>>>
> >>>>>>>>>>>> Let me spend some more thoughts on this and come back with a
> >>>>>>> concrete
> >>>>>>>>> proposal by early next week.
> >>>>>>>>>>>>
> >>>>>>>>>>>> Cheers,
> >>>>>>>>>>>> Timo
> >>>>>>>>>>>>
> >>>>>>>>>>>> [1]
> >>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
> >>>>>>>>>>>> [2]
> >>>>>>>>>
> >>>>>>
> >> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> >>>>>>>>>>>>
> >>>>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
> >>>>>>>>>>>>> Hey,Mayank
> >>>>>>>>>>>>> Please see my feedback as following:
> >>>>>>>>>>>>> 1. One of the motivations of this FLIP is to improve
> security.
> >>>>>>>>> However, the current design stores all connection information in
> >> the
> >>>>>>>>> catalog,
> >>>>>>>>>>>>> and each Flink SQL job reads from the catalog during
> >>>>>> compilation.
> >>>>>>>> The
> >>>>>>>>> connection information is passed between SQL Gateway and the
> >>>>>>>>>>>>> catalog in plaintext, which actually introduces new security
> >>>>>>> risks.
> >>>>>>>>>>>>> 2. The name "Connection" should be changed to something like
> >>>>>>>>> ConnectionSpec to clearly indicate that it is a object containing
> >>>>>> only
> >>>>>>>>> static
> >>>>>>>>>>>>> properties without a lifecycle. Putting aside the naming
> issue,
> >>>>>> I
> >>>>>>>>> think the current model and hierarchy design is somewhat strange.
> >>>>>>> Storing
> >>>>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the same
> >>>>>>>> Catalog
> >>>>>>>>> with hierarchical identifiers like
> >>>>>> catalog-name.db-name.connection-name
> >>>>>>>>>>>>> raises the following questions:
> >>>>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
> >>>>>>> Connection
> >>>>>>>>> object ?
> >>>>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
> >>>>>> can't
> >>>>>>> we
> >>>>>>>>> use a Connection to create a MySQL Catalog?
> >>>>>>>>>>>>> 3. Regarding the connector usage examples given in this FLIP:
> >>>>>>>>>>>>> ```sql
> >>>>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
> >>>>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> >>>>>>>>>>>>> 3  WITH (
> >>>>>>>>>>>>> 4    'type' = 'jdbc',
> >>>>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
> >>>>>>>>> customer-db.example.com:3306/customerdb',
> >>>>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> >>>>>>>>>>>>> 7  );
> >>>>>>>>>>>>> 8
> >>>>>>>>>>>>> 9  CREATE TABLE customers (
> >>>>>>>>>>>>> 10   customer_id INT,
> >>>>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> >>>>>>>>>>>>> 12 ) WITH (
> >>>>>>>>>>>>> 13   'connector' = 'jdbc',
> >>>>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
> >>>>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> >>>>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> >>>>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
> >>>>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> >>>>>>>>>>>>> 19 );
> >>>>>>>>>>>>> ```
> >>>>>>>>>>>>> I see three issues from SQL semantics and Connector
> >>>>>> compatibility
> >>>>>>>>> perspectives:
> >>>>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
> >> identifier
> >>>>>>> of
> >>>>>>>> a
> >>>>>>>>> CONNECTION defined in SQL. However, this identifier is referenced
> >>>>>>>>>>>>>    via a string value inside the table’s WITH clause, which
> >>>>>> feel
> >>>>>>>>> hack for me.
> >>>>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
> >>>>>>>>> `jdbc.connection` will confuse users because `connection.xx`
> maybe
> >>>>>>>> already
> >>>>>>>>> used as
> >>>>>>>>>>>>> a prefix for existing configuration items.
> >>>>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
> >>>>>> options
> >>>>>>>>> need to be prefixed with `jdbc`, even they’re not related to
> >>>>>> Connection
> >>>>>>>>> properties?
> >>>>>>>>>>>>> This completely changes user habits — is it backward
> >> compatible?
> >>>>>>>>>>>>> In my opinion, Connection should be a model independent of
> >> both
> >>>>>>>>> Catalog and Table, and can be referenced by all
> >>>>>> catalog/table/udf/model
> >>>>>>>>> object.
> >>>>>>>>>>>>> It should be managed by a Component such as a
> ConnectionManager
> >>>>>> to
> >>>>>>>>> enable reuse. For security purposes, authentication mechanisms
> >> could
> >>>>>>>>>>>>> be supported within the ConnectionManager.
> >>>>>>>>>>>>> Best,
> >>>>>>>>>>>>> Leonard
> >>>>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org>
> 写道:
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Hi all,
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> First of all, I think having a Connection resource is
> >> something
> >>>>>>>> that
> >>>>>>>>> will
> >>>>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
> >> extended
> >>>>>>> in
> >>>>>>>>> the
> >>>>>>>>>>>>>> future to allow for easier secret handling [1].
> >>>>>>>>>>>>>> In my mental mind, I'm comparing this proposal against
> SQL/MED
> >>>>>>> from
> >>>>>>>>> the ISO
> >>>>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
> >>>>>> friendly
> >>>>>>>>> syntax
> >>>>>>>>>>>>>> though, looking at Postgres for example [3].
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> I think it's a valid question if Connection should be
> >>>>>> considered
> >>>>>>>>> with a
> >>>>>>>>>>>>>> catalog or database-level scope. @Ryan can you share
> something
> >>>>>>>> more,
> >>>>>>>>> since
> >>>>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this
> case.
> >>>>>>> Which
> >>>>>>>>> is what
> >>>>>>>>>>>>>> we use internally to manage connection properties". It looks
> >>>>>> like
> >>>>>>>>> there
> >>>>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
> >>>>>>> (like,
> >>>>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
> >>>>>>>> database
> >>>>>>>>>>>>>> level).
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Also looking forward to Leonard's input.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Best regards,
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Martijn
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> >>>>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
> >>>>>>>>>>>>>> [3]
> >>>>>>> https://www.postgresql.org/docs/current/sql-createserver.html
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <
> xbjtdcq@gmail.com
> >>>
> >>>>>>>>> wrote:
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Hey Mayank.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
> >>>>>> found
> >>>>>>>> some
> >>>>>>>>>>>>>>> issues which I think we
> >>>>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon boat
> >>>>>>>>> Festival,
> >>>>>>>>>>>>>>> could you kindly hold
> >>>>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
> >> discuss.
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Best,
> >>>>>>>>>>>>>>> Leonard
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
> >>>>>> 写道:
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Hi all,
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Motivation:
> >>>>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
> >>>>>> defining
> >>>>>>>>> endpoints
> >>>>>>>>>>>>>>>> and credentials in table configuration. This approach
> >>>>>> prevents
> >>>>>>>>>>>>>>> reusability
> >>>>>>>>>>>>>>>> of these connections and makes table definition less
> secure
> >>>>>> by
> >>>>>>>>> exposing
> >>>>>>>>>>>>>>>> sensitive information.
> >>>>>>>>>>>>>>>> We propose the introduction of a new "connection" resource
> >> in
> >>>>>>>>> Flink. This
> >>>>>>>>>>>>>>>> will be a pluggable resource configured with a remote
> >>>>>> endpoint
> >>>>>>>> and
> >>>>>>>>>>>>>>>> associated access key. Once defined, connections can be
> >>>>>> reused
> >>>>>>>>> across
> >>>>>>>>>>>>>>> table
> >>>>>>>>>>>>>>>> definitions, and eventually for model definition (as
> >>>>>> discussed
> >>>>>>> in
> >>>>>>>>>>>>>>> FLIP-437)
> >>>>>>>>>>>>>>>> for inference, enabling seamless and secure integration
> with
> >>>>>>>>> external
> >>>>>>>>>>>>>>>> systems.
> >>>>>>>>>>>>>>>> The connection resource will provide a new, optional way
> to
> >>>>>>>> manage
> >>>>>>>>>>>>>>> external
> >>>>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
> >> definitions
> >>>>>>>> will
> >>>>>>>>> remain
> >>>>>>>>>>>>>>>> unchanged.
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>> Best Regards,
> >>>>>>>>>>>>>>>> Mayank Juneja
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> *Mayank Juneja*
> >>>>>>>> Product Manager | Data Streaming and AI
> >>>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>
> >>
>
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
Hey, Hao

Please see my comments as follows:

>> 2. I think we can also modify the create catalog ddl syntax.
> 
> ```
> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> WITH (
>    'type' = 'jdbc'
> );
> ```
> 
> Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
> chicken-egg problem. I think for connections to be used for catalog
> creation, it needs to be system connection similar to system function which
> exist outside of CatalogManager. Maybe we can defer this to later
> functionality?

I think connection is a very common need for most catalogs like MySQLCatalog、KafkaCatalog、HiveCatalog and so on, all of these catalogs need a connection.


>> 3. It seems the connector factory should merge the with options and
> connection options together and then create the source/sink. It's
> better that framework can merge all these options and connectors don't need
> any codes.
> 
> I think it's better to separate connections with table options and make it
> explicit. Reasons is: the connection here should be a decrypted one. It's
> sensitive and should be handled carefully regarding logging, usage etc.
> Mixing with original table options makes it hard to do. But the Flip used
> `CatalogConnection` which is an encrypted one. I'll update it to
> `SensitveConnection`.
>> (4)Framework-level Resolution : +1 to Shengkai's point about having the
> framework (DynamicTableFactory) return complete options to reduce connector
> adaptation cost.
> 
> Please see my explanation for Shengkai's similar question.

In this case, I think reducing connector development cost is more important than making is explicit, the connector knows which options is sensitive or not.


>> 4. Why we need to introduce ConnectionFactory? I think connection is like
> CatalogTable. It should hold the basic information and all information in
> the connection should be stored into secret store.
> 
> The main reason is to enable user defined connection handling for different
> types. For example, if connection type is `basic`, the corresponding
> factory can handle basic type secrets (e.g. extract username/password from
> connection options and do encryption).
> 
>> (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
> in BasicConnectionFactory be made configurable (e.g., 'token' vs
> 'accessKey') for better connector compatibility?
> 
> This depends on `ConnectionFactory` implementation and can be self defined
> by user.

I hope the BasicConnectionFactory can be a common one that can feed most common users case, otherwise encrypt all options is a good idea.

Btw, I also want to push the FLIP forward and start a vote ASAP, thus a meeting is welcome if you think it can help finalizing the discussion thread.


Best,
Leonard



> 
>> Hi friends
>> 
>> I like the updated FLIP goals, that’s what I want. I’ve some feedback:
>> 
>> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
>> SecretStore?
>> (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
>> in BasicConnectionFactory be made configurable (e.g., 'token' vs
>> 'accessKey') for better connector compatibility?
>> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection returns
>> SensitiveConnection, while BasicConnectionFactory#resolveConnection returns
>> Map<String, String>. Should these be aligned?
>> (4)Framework-level Resolution : +1 to Shengkai's point about having the
>> framework (DynamicTableFactory) return complete options to reduce connector
>> adaptation cost.
>> (5)Secret ID Handling : When no encryption is needed, secretId is null
>> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This
>> behavior should be explicitly documented in the interfaces.
>> 
>> Best,
>> Leonard
>> 
>>> 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
>>> 
>>> hi.
>>> 
>>> Sorry for the late reply. I just have some questions:
>>> 
>>> 1. Why SecretStoreFactory#open throws a CatalogException? I think the
>>> exteranl system can not handle this exception.
>>> 
>>> 2. I think we can also modify the create catalog ddl syntax.
>>> 
>>> ```
>>> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
>>> WITH (
>>>   'type' = 'jdbc'
>>> );
>>> ```
>>> 
>>> 3. It seems the connector factory should merge the with options and
>>> connection options together and then create the source/sink. It's
>>> better that framework can merge all these options and connectors don't
>> need
>>> any codes.
>>> 
>>> 4. Why we need to introduce ConnectionFactory? I think connection is like
>>> CatalogTable. It should hold the basic information and all information in
>>> the connection should be stored into secret store.
>>> 
>>> 
>>> Best,
>>> Shengkai
>>> 
>>> 
>>> Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
>>> 
>>>> Hi Mayank,
>>>> 
>>>> Thanks for updating the FLIP and clearly documenting our discussion.
>>>> 
>>>> +1 for moving forward with the vote, unless there are objections from
>>>> others.
>>>> 
>>>> Cheers,
>>>> Timo
>>>> 
>>>> On 22.07.25 02:14, Mayank Juneja wrote:
>>>>> Hi Ryan and Austin,
>>>>> 
>>>>> Thanks for your suggestions. I've updated the FLIP with the following
>>>>> additional info -
>>>>> 
>>>>> 1. *table.secret-store.kind* key to register the SecretStore in a yaml
>>>> file
>>>>> 2. *updateSecret* method in WritableSecretStore interface
>>>>> 
>>>>> Thanks,
>>>>> Mayank
>>>>> 
>>>>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
>>>>> austin.cawley@gmail.com> wrote:
>>>>> 
>>>>>> Hey all,
>>>>>> 
>>>>>> Thanks for the nice flip all! I’m just reading through – had one
>>>> question
>>>>>> on the ALTER CONNECTION implementation flow. Would it make sense for
>> the
>>>>>> WritableSecretStore to expose a method for updating a secret by ID, so
>>>> it
>>>>>> can be done atomically? Else, would we need to call delete and create
>>>>>> again, potentially introducing concurrent resolution errors?
>>>>>> 
>>>>>> Best,
>>>>>> Austin
>>>>>> 
>>>>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
>>>>>> <ry...@shopify.com.invalid> wrote:
>>>>>> 
>>>>>>> Hi Mayank,
>>>>>>> 
>>>>>>> Thanks for updating the FLIP. Overall it looks good to me.
>>>>>>> 
>>>>>>> One question I had related to how someone could choose the
>> SecretStore
>>>>>> they
>>>>>>> want to use if they use something like the SQL Gateway as the
>>>> entrypoint
>>>>>> on
>>>>>>> top of a remote Session cluster. I don't see an explicit way to set
>> the
>>>>>>> SecretStore in the FLIP.
>>>>>>> I assume we'll do it similar to the CatalogStore but I wanted to call
>>>>>> this
>>>>>>> out.
>>>>>>> 
>>>>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
>>>>>>> file:///path/to/catalog/store/
>>>>>>> 
>>>>>>> Ryan van Huuksloot
>>>>>>> Staff Engineer, Infrastructure | Streaming Platform
>>>>>>> [image: Shopify]
>>>>>>> <
>>>> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
>>>> mayankjuneja27@gmail.com>
>>>>>>> wrote:
>>>>>>> 
>>>>>>>> Hi everyone,
>>>>>>>> 
>>>>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
>>>> ideas
>>>>>>>> proposed earlier in the thread. Looking forward to your feedback.
>>>>>>>> https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>> 
>>>>>>>> Best,
>>>>>>>> Mayank
>>>>>>>> 
>>>>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
>> wrote:
>>>>>>>> 
>>>>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The
>> new
>>>>>>>>> proposal looks well, +1 from my side.
>>>>>>>>> 
>>>>>>>>> Could you draft(update) current FLIP docs thus we can have some
>>>>>>> specific
>>>>>>>>> discussions later?
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Best,
>>>>>>>>> Leonard
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>>> 
>>>>>>>>>> Hi everyone,
>>>>>>>>>> 
>>>>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank, Hao
>>>>>>> and
>>>>>>>> I
>>>>>>>>> synced offline and came up we an improved proposal. Before we
>> update
>>>>>>> the
>>>>>>>>> FLIP let me summarize the most important key facts that hopefully
>>>>>>> address
>>>>>>>>> most concerns:
>>>>>>>>>> 
>>>>>>>>>> 1) SecretStore
>>>>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
>>>>>> highest
>>>>>>>>> level in TableEnvironment.
>>>>>>>>>> - SecretStore is initialized with options and potentially
>>>>>> environment
>>>>>>>>> variables. Including
>>>>>> EnvironmentSettings.withSecretStore(SecretStore).
>>>>>>>>>> - The SecretStore is pluggable and discovered using the regular
>>>>>>>>> factory-approach.
>>>>>>>>>> - For example, it could implement Azure Key Vault or other cloud
>>>>>>>>> provider secrets stores.
>>>>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
>> sensitive
>>>>>>>> data.
>>>>>>>>>> 
>>>>>>>>>> 2) Connections
>>>>>>>>>> - Connections are catalog objects identified with 3-part
>>>>>> identifiers.
>>>>>>>>> 3-part identifiers are crucial for managability of larger projects
>>>>>> and
>>>>>>>>> align with existing catalog objects.
>>>>>>>>>> - They contain connection details, e.g. URL, query parameters, and
>>>>>>>> other
>>>>>>>>> configuration.
>>>>>>>>>> - They do not contain secrets, but only pointers to secrets in the
>>>>>>>>> SecretStore.
>>>>>>>>>> 
>>>>>>>>>> 3) Connection DDL
>>>>>>>>>> 
>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>> 'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>>>>>>>>>> ...
>>>>>>>>>> )
>>>>>>>>>> 
>>>>>>>>>> - Connection type is pluggable and discovered using the regular
>>>>>>>>> factory-approach.
>>>>>>>>>> - The factory extracts secrets and puts them into SecretStore.
>>>>>>>>>> - The factory only leaves non-confidential options left that can
>> be
>>>>>>>>> stored in a catalog.
>>>>>>>>>> 
>>>>>>>>>> When executing:
>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>> 'type' = 'basic',
>>>>>>>>>> 'url' = 'api.example.com',
>>>>>>>>>> 'username' = 'bob',
>>>>>>>>>> 'password' = 'xyz'
>>>>>>>>>> )
>>>>>>>>>> 
>>>>>>>>>> The catalog will receive something similar to:
>>>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>>> 'type' = 'basic',
>>>>>>>>>> 'url' = 'api.example.com',
>>>>>>>>>> 'secret.store' = 'azure-key-vault'
>>>>>>>>>> 'secret.id' = 'secretId'
>>>>>>>>>> )
>>>>>>>>>> 
>>>>>>>>>> - However, the exact property design is up to the connection
>>>>>> factory.
>>>>>>>>>> 
>>>>>>>>>> 4) Connection Usage
>>>>>>>>>> 
>>>>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
>>>>>>>>>> 
>>>>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
>>>>>>>>> similar to BigQuery.
>>>>>>>>>> - The connection will be provided in a table/model
>>>>>> provider/function
>>>>>>>>> definition factory.
>>>>>>>>>> 
>>>>>>>>>> 5) CatalogStore / Catalog Initialization
>>>>>>>>>> 
>>>>>>>>>> Catalog store or catalog can make use of SecretStore to retrieve
>>>>>>>> initial
>>>>>>>>> credentials for bootstrapping. All objects lower then catalog
>>>>>>>> store/catalog
>>>>>>>>> can then use connections. If you think we still need system level
>>>>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
>> WITH
>>>>>>> (..)
>>>>>>>>> similar to SYSTEM functions directly store in a ConnectioManager in
>>>>>>>>> TableEnvironment. But for now I would suggest to start simple with
>>>>>>>>> per-catalog connections and later evolve the design.
>>>>>>>>>> 
>>>>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly not
>>>>>> an
>>>>>>>>> expert on it. This is why we should try to push the problem to
>>>>>> existing
>>>>>>>>> solutions and don't start storing secrets in Flink in any way.
>> Thus,
>>>>>>> the
>>>>>>>>> interfaces will be defined very generic.
>>>>>>>>>> 
>>>>>>>>>> Looking forward to your feedback.
>>>>>>>>>> 
>>>>>>>>>> Cheers,
>>>>>>>>>> Timo
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
>>>>>>>>>>> Thanks  Timo for joining this thread.
>>>>>>>>>>> I agree that this feature is needed by the community; the current
>>>>>>>>> disagreement is only about the implementation method or solution.
>>>>>>>>>>> Your thoughts looks generally good to me, looking forward to your
>>>>>>>>> proposal.
>>>>>>>>>>> Best,
>>>>>>>>>>> Leonard
>>>>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>>>>> 
>>>>>>>>>>>> Hi everyone,
>>>>>>>>>>>> 
>>>>>>>>>>>> thanks for this healthy discussion. Looking at high number of
>>>>>>>>> participants, it looks like we definitely want this feature. We
>> just
>>>>>>> need
>>>>>>>>> to figure out the "how".
>>>>>>>>>>>> 
>>>>>>>>>>>> This reminds me very much of the discussion we had for CREATE
>>>>>>>>> FUNCTION. There, we discussed whether functions should be named
>>>>>>> globally
>>>>>>>> or
>>>>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
>>>>>>>> FUNCTION`
>>>>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team of an
>>>>>>>>> organization (which might provide system functions) and individual
>>>>>> data
>>>>>>>>> teams or use cases (scoped by catalog/database).
>>>>>>>>>>>> 
>>>>>>>>>>>> Looking at other modern vendors like Snowflake there is SECRET
>>>>>>>> (scoped
>>>>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So also
>>>>>>> other
>>>>>>>>> vendors offer global and per-team / per-use case connections
>> details.
>>>>>>>>>>>> 
>>>>>>>>>>>> In general, I think fitting connections into the existing
>>>>>> concepts
>>>>>>>> for
>>>>>>>>> catalog objects (with three-part identifier) makes managing them
>>>>>>> easier.
>>>>>>>>> But I also see the need for global defaults.
>>>>>>>>>>>> 
>>>>>>>>>>>> Btw keep in mind that a catalog implementation should only store
>>>>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
>> data, a
>>>>>>>>> CatalogConnection should not store the credentials. It should only
>>>>>>> offer
>>>>>>>> a
>>>>>>>>> factory that allows for storing and retrieving them. In real world
>>>>>>>>> scenarios a factory is most likely backed by a product like Azure
>> Key
>>>>>>>> Vault.
>>>>>>>>>>>> 
>>>>>>>>>>>> So code-wise having a ConnectionManager that behaves similar to
>>>>>>>>> FunctionManager sounds reasonable.
>>>>>>>>>>>> 
>>>>>>>>>>>> +1 for having special syntax instead of using properties. This
>>>>>>> allows
>>>>>>>>> to access connections in tables, models, functions. And catalogs,
>> if
>>>>>> we
>>>>>>>>> agree to have global ones as well.
>>>>>>>>>>>> 
>>>>>>>>>>>> What do you think?
>>>>>>>>>>>> 
>>>>>>>>>>>> Let me spend some more thoughts on this and come back with a
>>>>>>> concrete
>>>>>>>>> proposal by early next week.
>>>>>>>>>>>> 
>>>>>>>>>>>> Cheers,
>>>>>>>>>>>> Timo
>>>>>>>>>>>> 
>>>>>>>>>>>> [1]
>>>>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
>>>>>>>>>>>> [2]
>>>>>>>>> 
>>>>>> 
>> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>>>>>>>>>>>> 
>>>>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
>>>>>>>>>>>>> Hey,Mayank
>>>>>>>>>>>>> Please see my feedback as following:
>>>>>>>>>>>>> 1. One of the motivations of this FLIP is to improve security.
>>>>>>>>> However, the current design stores all connection information in
>> the
>>>>>>>>> catalog,
>>>>>>>>>>>>> and each Flink SQL job reads from the catalog during
>>>>>> compilation.
>>>>>>>> The
>>>>>>>>> connection information is passed between SQL Gateway and the
>>>>>>>>>>>>> catalog in plaintext, which actually introduces new security
>>>>>>> risks.
>>>>>>>>>>>>> 2. The name "Connection" should be changed to something like
>>>>>>>>> ConnectionSpec to clearly indicate that it is a object containing
>>>>>> only
>>>>>>>>> static
>>>>>>>>>>>>> properties without a lifecycle. Putting aside the naming issue,
>>>>>> I
>>>>>>>>> think the current model and hierarchy design is somewhat strange.
>>>>>>> Storing
>>>>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the same
>>>>>>>> Catalog
>>>>>>>>> with hierarchical identifiers like
>>>>>> catalog-name.db-name.connection-name
>>>>>>>>>>>>> raises the following questions:
>>>>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
>>>>>>> Connection
>>>>>>>>> object ?
>>>>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
>>>>>> can't
>>>>>>> we
>>>>>>>>> use a Connection to create a MySQL Catalog?
>>>>>>>>>>>>> 3. Regarding the connector usage examples given in this FLIP:
>>>>>>>>>>>>> ```sql
>>>>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
>>>>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>>>>>>>>>>>>> 3  WITH (
>>>>>>>>>>>>> 4    'type' = 'jdbc',
>>>>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
>>>>>>>>> customer-db.example.com:3306/customerdb',
>>>>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>>>>>>>>>>>>> 7  );
>>>>>>>>>>>>> 8
>>>>>>>>>>>>> 9  CREATE TABLE customers (
>>>>>>>>>>>>> 10   customer_id INT,
>>>>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>>>>>>>>>>>>> 12 ) WITH (
>>>>>>>>>>>>> 13   'connector' = 'jdbc',
>>>>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
>>>>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>>>>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>>>>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
>>>>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>>>>>>>>>>>>> 19 );
>>>>>>>>>>>>> ```
>>>>>>>>>>>>> I see three issues from SQL semantics and Connector
>>>>>> compatibility
>>>>>>>>> perspectives:
>>>>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
>> identifier
>>>>>>> of
>>>>>>>> a
>>>>>>>>> CONNECTION defined in SQL. However, this identifier is referenced
>>>>>>>>>>>>>    via a string value inside the table’s WITH clause, which
>>>>>> feel
>>>>>>>>> hack for me.
>>>>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
>>>>>>>>> `jdbc.connection` will confuse users because `connection.xx` maybe
>>>>>>>> already
>>>>>>>>> used as
>>>>>>>>>>>>> a prefix for existing configuration items.
>>>>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
>>>>>> options
>>>>>>>>> need to be prefixed with `jdbc`, even they’re not related to
>>>>>> Connection
>>>>>>>>> properties?
>>>>>>>>>>>>> This completely changes user habits — is it backward
>> compatible?
>>>>>>>>>>>>> In my opinion, Connection should be a model independent of
>> both
>>>>>>>>> Catalog and Table, and can be referenced by all
>>>>>> catalog/table/udf/model
>>>>>>>>> object.
>>>>>>>>>>>>> It should be managed by a Component such as a ConnectionManager
>>>>>> to
>>>>>>>>> enable reuse. For security purposes, authentication mechanisms
>> could
>>>>>>>>>>>>> be supported within the ConnectionManager.
>>>>>>>>>>>>> Best,
>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> First of all, I think having a Connection resource is
>> something
>>>>>>>> that
>>>>>>>>> will
>>>>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
>> extended
>>>>>>> in
>>>>>>>>> the
>>>>>>>>>>>>>> future to allow for easier secret handling [1].
>>>>>>>>>>>>>> In my mental mind, I'm comparing this proposal against SQL/MED
>>>>>>> from
>>>>>>>>> the ISO
>>>>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
>>>>>> friendly
>>>>>>>>> syntax
>>>>>>>>>>>>>> though, looking at Postgres for example [3].
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> I think it's a valid question if Connection should be
>>>>>> considered
>>>>>>>>> with a
>>>>>>>>>>>>>> catalog or database-level scope. @Ryan can you share something
>>>>>>>> more,
>>>>>>>>> since
>>>>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this case.
>>>>>>> Which
>>>>>>>>> is what
>>>>>>>>>>>>>> we use internally to manage connection properties". It looks
>>>>>> like
>>>>>>>>> there
>>>>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
>>>>>>> (like,
>>>>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
>>>>>>>> database
>>>>>>>>>>>>>> level).
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Also looking forward to Leonard's input.
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Best regards,
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Martijn
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>>>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
>>>>>>>>>>>>>> [3]
>>>>>>> https://www.postgresql.org/docs/current/sql-createserver.html
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xbjtdcq@gmail.com
>>> 
>>>>>>>>> wrote:
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Hey Mayank.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
>>>>>> found
>>>>>>>> some
>>>>>>>>>>>>>>> issues which I think we
>>>>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon boat
>>>>>>>>> Festival,
>>>>>>>>>>>>>>> could you kindly hold
>>>>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
>> discuss.
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> Best,
>>>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
>>>>>> 写道:
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> Motivation:
>>>>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
>>>>>> defining
>>>>>>>>> endpoints
>>>>>>>>>>>>>>>> and credentials in table configuration. This approach
>>>>>> prevents
>>>>>>>>>>>>>>> reusability
>>>>>>>>>>>>>>>> of these connections and makes table definition less secure
>>>>>> by
>>>>>>>>> exposing
>>>>>>>>>>>>>>>> sensitive information.
>>>>>>>>>>>>>>>> We propose the introduction of a new "connection" resource
>> in
>>>>>>>>> Flink. This
>>>>>>>>>>>>>>>> will be a pluggable resource configured with a remote
>>>>>> endpoint
>>>>>>>> and
>>>>>>>>>>>>>>>> associated access key. Once defined, connections can be
>>>>>> reused
>>>>>>>>> across
>>>>>>>>>>>>>>> table
>>>>>>>>>>>>>>>> definitions, and eventually for model definition (as
>>>>>> discussed
>>>>>>> in
>>>>>>>>>>>>>>> FLIP-437)
>>>>>>>>>>>>>>>> for inference, enabling seamless and secure integration with
>>>>>>>>> external
>>>>>>>>>>>>>>>> systems.
>>>>>>>>>>>>>>>> The connection resource will provide a new, optional way to
>>>>>>>> manage
>>>>>>>>>>>>>>> external
>>>>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
>> definitions
>>>>>>>> will
>>>>>>>>> remain
>>>>>>>>>>>>>>>> unchanged.
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>>>> Mayank Juneja
>>>>>>>>>>>>>>> 
>>>>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> --
>>>>>>>> *Mayank Juneja*
>>>>>>>> Product Manager | Data Streaming and AI
>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>> 
>> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hao Li <hl...@confluent.io.INVALID>.
Hi Shengkai, Leonard,

Thanks for the feedback.

For Shengkai's feedback:

> 1. Why SecretStoreFactory#open throws a CatalogException? I think the
exteranl system can not handle this exception.
You are right, we can make it throw `Exception`

> 2. I think we can also modify the create catalog ddl syntax.

```
CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
WITH (
    'type' = 'jdbc'
);
```

Does `mycat.mydb.mysql_prod` exist in another catalog? This feels like a
chicken-egg problem. I think for connections to be used for catalog
creation, it needs to be system connection similar to system function which
exist outside of CatalogManager. Maybe we can defer this to later
functionality?

> 3. It seems the connector factory should merge the with options and
connection options together and then create the source/sink. It's
better that framework can merge all these options and connectors don't need
any codes.

I think it's better to separate connections with table options and make it
explicit. Reasons is: the connection here should be a decrypted one. It's
sensitive and should be handled carefully regarding logging, usage etc.
Mixing with original table options makes it hard to do. But the Flip used
`CatalogConnection` which is an encrypted one. I'll update it to
`SensitveConnection`.

> 4. Why we need to introduce ConnectionFactory? I think connection is like
CatalogTable. It should hold the basic information and all information in
the connection should be stored into secret store.

The main reason is to enable user defined connection handling for different
types. For example, if connection type is `basic`, the corresponding
factory can handle basic type secrets (e.g. extract username/password from
connection options and do encryption).

For Leonard's feedback:
> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
SecretStore?

Good catch. Let me update it.

>  (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
in BasicConnectionFactory be made configurable (e.g., 'token' vs
'accessKey') for better connector compatibility?

This depends on `ConnectionFactory` implementation and can be self defined
by user.

> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection
returns SensitiveConnection, while BasicConnectionFactory#resolveConnection
returns Map<String, String>. Should these be aligned?

Good catch. Let me update the FLIP.

> (4)Framework-level Resolution : +1 to Shengkai's point about having the
framework (DynamicTableFactory) return complete options to reduce connector
adaptation cost.

Please see my explanation for Shengkai's similar question.

> (5)Secret ID Handling : When no encryption is needed, secretId is null
(from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This
behavior should be explicitly documented in the interfaces.

It's an example in the FLIP about how `ConnectionFactory` could be
implemented. How encryption is done depends on actual implementation
though. Let me update the example to make it more clear.

Thanks,
Hao

On Thu, Jul 24, 2025 at 5:04 AM Leonard Xu <xb...@gmail.com> wrote:

> Hi friends
>
> I like the updated FLIP goals, that’s what I want. I’ve some feedback:
>
> (1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend
> SecretStore?
> (2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS
> in BasicConnectionFactory be made configurable (e.g., 'token' vs
> 'accessKey') for better connector compatibility?
> (3)Inconsistent Return Types : ConnectionFactory#resolveConnection returns
> SensitiveConnection, while BasicConnectionFactory#resolveConnection returns
> Map<String, String>. Should these be aligned?
> (4)Framework-level Resolution : +1 to Shengkai's point about having the
> framework (DynamicTableFactory) return complete options to reduce connector
> adaptation cost.
> (5)Secret ID Handling : When no encryption is needed, secretId is null
> (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This
> behavior should be explicitly documented in the interfaces.
>
> Best,
> Leonard
>
> > 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
> >
> > hi.
> >
> > Sorry for the late reply. I just have some questions:
> >
> > 1. Why SecretStoreFactory#open throws a CatalogException? I think the
> > exteranl system can not handle this exception.
> >
> > 2. I think we can also modify the create catalog ddl syntax.
> >
> > ```
> > CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> > WITH (
> >    'type' = 'jdbc'
> > );
> > ```
> >
> > 3. It seems the connector factory should merge the with options and
> > connection options together and then create the source/sink. It's
> > better that framework can merge all these options and connectors don't
> need
> > any codes.
> >
> > 4. Why we need to introduce ConnectionFactory? I think connection is like
> > CatalogTable. It should hold the basic information and all information in
> > the connection should be stored into secret store.
> >
> >
> > Best,
> > Shengkai
> >
> >
> > Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
> >
> >> Hi Mayank,
> >>
> >> Thanks for updating the FLIP and clearly documenting our discussion.
> >>
> >> +1 for moving forward with the vote, unless there are objections from
> >> others.
> >>
> >> Cheers,
> >> Timo
> >>
> >> On 22.07.25 02:14, Mayank Juneja wrote:
> >>> Hi Ryan and Austin,
> >>>
> >>> Thanks for your suggestions. I've updated the FLIP with the following
> >>> additional info -
> >>>
> >>> 1. *table.secret-store.kind* key to register the SecretStore in a yaml
> >> file
> >>> 2. *updateSecret* method in WritableSecretStore interface
> >>>
> >>> Thanks,
> >>> Mayank
> >>>
> >>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
> >>> austin.cawley@gmail.com> wrote:
> >>>
> >>>> Hey all,
> >>>>
> >>>> Thanks for the nice flip all! I’m just reading through – had one
> >> question
> >>>> on the ALTER CONNECTION implementation flow. Would it make sense for
> the
> >>>> WritableSecretStore to expose a method for updating a secret by ID, so
> >> it
> >>>> can be done atomically? Else, would we need to call delete and create
> >>>> again, potentially introducing concurrent resolution errors?
> >>>>
> >>>> Best,
> >>>> Austin
> >>>>
> >>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
> >>>> <ry...@shopify.com.invalid> wrote:
> >>>>
> >>>>> Hi Mayank,
> >>>>>
> >>>>> Thanks for updating the FLIP. Overall it looks good to me.
> >>>>>
> >>>>> One question I had related to how someone could choose the
> SecretStore
> >>>> they
> >>>>> want to use if they use something like the SQL Gateway as the
> >> entrypoint
> >>>> on
> >>>>> top of a remote Session cluster. I don't see an explicit way to set
> the
> >>>>> SecretStore in the FLIP.
> >>>>> I assume we'll do it similar to the CatalogStore but I wanted to call
> >>>> this
> >>>>> out.
> >>>>>
> >>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
> >>>>> file:///path/to/catalog/store/
> >>>>>
> >>>>> Ryan van Huuksloot
> >>>>> Staff Engineer, Infrastructure | Streaming Platform
> >>>>> [image: Shopify]
> >>>>> <
> >> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
> >>>>>
> >>>>>
> >>>>>
> >>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
> >> mayankjuneja27@gmail.com>
> >>>>> wrote:
> >>>>>
> >>>>>> Hi everyone,
> >>>>>>
> >>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
> >> ideas
> >>>>>> proposed earlier in the thread. Looking forward to your feedback.
> >>>>>> https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>
> >>>>>> Best,
> >>>>>> Mayank
> >>>>>>
> >>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com>
> wrote:
> >>>>>>
> >>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The
> new
> >>>>>>> proposal looks well, +1 from my side.
> >>>>>>>
> >>>>>>> Could you draft(update) current FLIP docs thus we can have some
> >>>>> specific
> >>>>>>> discussions later?
> >>>>>>>
> >>>>>>>
> >>>>>>> Best,
> >>>>>>> Leonard
> >>>>>>>
> >>>>>>>
> >>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> >>>>>>>>
> >>>>>>>> Hi everyone,
> >>>>>>>>
> >>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank, Hao
> >>>>> and
> >>>>>> I
> >>>>>>> synced offline and came up we an improved proposal. Before we
> update
> >>>>> the
> >>>>>>> FLIP let me summarize the most important key facts that hopefully
> >>>>> address
> >>>>>>> most concerns:
> >>>>>>>>
> >>>>>>>> 1) SecretStore
> >>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
> >>>> highest
> >>>>>>> level in TableEnvironment.
> >>>>>>>> - SecretStore is initialized with options and potentially
> >>>> environment
> >>>>>>> variables. Including
> >>>> EnvironmentSettings.withSecretStore(SecretStore).
> >>>>>>>> - The SecretStore is pluggable and discovered using the regular
> >>>>>>> factory-approach.
> >>>>>>>> - For example, it could implement Azure Key Vault or other cloud
> >>>>>>> provider secrets stores.
> >>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with
> sensitive
> >>>>>> data.
> >>>>>>>>
> >>>>>>>> 2) Connections
> >>>>>>>> - Connections are catalog objects identified with 3-part
> >>>> identifiers.
> >>>>>>> 3-part identifiers are crucial for managability of larger projects
> >>>> and
> >>>>>>> align with existing catalog objects.
> >>>>>>>> - They contain connection details, e.g. URL, query parameters, and
> >>>>>> other
> >>>>>>> configuration.
> >>>>>>>> - They do not contain secrets, but only pointers to secrets in the
> >>>>>>> SecretStore.
> >>>>>>>>
> >>>>>>>> 3) Connection DDL
> >>>>>>>>
> >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> >>>>>>>>  ...
> >>>>>>>> )
> >>>>>>>>
> >>>>>>>> - Connection type is pluggable and discovered using the regular
> >>>>>>> factory-approach.
> >>>>>>>> - The factory extracts secrets and puts them into SecretStore.
> >>>>>>>> - The factory only leaves non-confidential options left that can
> be
> >>>>>>> stored in a catalog.
> >>>>>>>>
> >>>>>>>> When executing:
> >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>  'type' = 'basic',
> >>>>>>>>  'url' = 'api.example.com',
> >>>>>>>>  'username' = 'bob',
> >>>>>>>>  'password' = 'xyz'
> >>>>>>>> )
> >>>>>>>>
> >>>>>>>> The catalog will receive something similar to:
> >>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>>>  'type' = 'basic',
> >>>>>>>>  'url' = 'api.example.com',
> >>>>>>>>  'secret.store' = 'azure-key-vault'
> >>>>>>>>  'secret.id' = 'secretId'
> >>>>>>>> )
> >>>>>>>>
> >>>>>>>> - However, the exact property design is up to the connection
> >>>> factory.
> >>>>>>>>
> >>>>>>>> 4) Connection Usage
> >>>>>>>>
> >>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> >>>>>>>>
> >>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
> >>>>>>> similar to BigQuery.
> >>>>>>>> - The connection will be provided in a table/model
> >>>> provider/function
> >>>>>>> definition factory.
> >>>>>>>>
> >>>>>>>> 5) CatalogStore / Catalog Initialization
> >>>>>>>>
> >>>>>>>> Catalog store or catalog can make use of SecretStore to retrieve
> >>>>>> initial
> >>>>>>> credentials for bootstrapping. All objects lower then catalog
> >>>>>> store/catalog
> >>>>>>> can then use connections. If you think we still need system level
> >>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName
> WITH
> >>>>> (..)
> >>>>>>> similar to SYSTEM functions directly store in a ConnectioManager in
> >>>>>>> TableEnvironment. But for now I would suggest to start simple with
> >>>>>>> per-catalog connections and later evolve the design.
> >>>>>>>>
> >>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly not
> >>>> an
> >>>>>>> expert on it. This is why we should try to push the problem to
> >>>> existing
> >>>>>>> solutions and don't start storing secrets in Flink in any way.
> Thus,
> >>>>> the
> >>>>>>> interfaces will be defined very generic.
> >>>>>>>>
> >>>>>>>> Looking forward to your feedback.
> >>>>>>>>
> >>>>>>>> Cheers,
> >>>>>>>> Timo
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
> >>>>>>>>> Thanks  Timo for joining this thread.
> >>>>>>>>> I agree that this feature is needed by the community; the current
> >>>>>>> disagreement is only about the implementation method or solution.
> >>>>>>>>> Your thoughts looks generally good to me, looking forward to your
> >>>>>>> proposal.
> >>>>>>>>> Best,
> >>>>>>>>> Leonard
> >>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> >>>>>>>>>>
> >>>>>>>>>> Hi everyone,
> >>>>>>>>>>
> >>>>>>>>>> thanks for this healthy discussion. Looking at high number of
> >>>>>>> participants, it looks like we definitely want this feature. We
> just
> >>>>> need
> >>>>>>> to figure out the "how".
> >>>>>>>>>>
> >>>>>>>>>> This reminds me very much of the discussion we had for CREATE
> >>>>>>> FUNCTION. There, we discussed whether functions should be named
> >>>>> globally
> >>>>>> or
> >>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
> >>>>>> FUNCTION`
> >>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team of an
> >>>>>>> organization (which might provide system functions) and individual
> >>>> data
> >>>>>>> teams or use cases (scoped by catalog/database).
> >>>>>>>>>>
> >>>>>>>>>> Looking at other modern vendors like Snowflake there is SECRET
> >>>>>> (scoped
> >>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So also
> >>>>> other
> >>>>>>> vendors offer global and per-team / per-use case connections
> details.
> >>>>>>>>>>
> >>>>>>>>>> In general, I think fitting connections into the existing
> >>>> concepts
> >>>>>> for
> >>>>>>> catalog objects (with three-part identifier) makes managing them
> >>>>> easier.
> >>>>>>> But I also see the need for global defaults.
> >>>>>>>>>>
> >>>>>>>>>> Btw keep in mind that a catalog implementation should only store
> >>>>>>> metadata. Similar how a CatalogTable doesn't store the actual
> data, a
> >>>>>>> CatalogConnection should not store the credentials. It should only
> >>>>> offer
> >>>>>> a
> >>>>>>> factory that allows for storing and retrieving them. In real world
> >>>>>>> scenarios a factory is most likely backed by a product like Azure
> Key
> >>>>>> Vault.
> >>>>>>>>>>
> >>>>>>>>>> So code-wise having a ConnectionManager that behaves similar to
> >>>>>>> FunctionManager sounds reasonable.
> >>>>>>>>>>
> >>>>>>>>>> +1 for having special syntax instead of using properties. This
> >>>>> allows
> >>>>>>> to access connections in tables, models, functions. And catalogs,
> if
> >>>> we
> >>>>>>> agree to have global ones as well.
> >>>>>>>>>>
> >>>>>>>>>> What do you think?
> >>>>>>>>>>
> >>>>>>>>>> Let me spend some more thoughts on this and come back with a
> >>>>> concrete
> >>>>>>> proposal by early next week.
> >>>>>>>>>>
> >>>>>>>>>> Cheers,
> >>>>>>>>>> Timo
> >>>>>>>>>>
> >>>>>>>>>> [1]
> >>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
> >>>>>>>>>> [2]
> >>>>>>>
> >>>>
> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> >>>>>>>>>>
> >>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
> >>>>>>>>>>> Hey,Mayank
> >>>>>>>>>>> Please see my feedback as following:
> >>>>>>>>>>> 1. One of the motivations of this FLIP is to improve security.
> >>>>>>> However, the current design stores all connection information in
> the
> >>>>>>> catalog,
> >>>>>>>>>>> and each Flink SQL job reads from the catalog during
> >>>> compilation.
> >>>>>> The
> >>>>>>> connection information is passed between SQL Gateway and the
> >>>>>>>>>>> catalog in plaintext, which actually introduces new security
> >>>>> risks.
> >>>>>>>>>>> 2. The name "Connection" should be changed to something like
> >>>>>>> ConnectionSpec to clearly indicate that it is a object containing
> >>>> only
> >>>>>>> static
> >>>>>>>>>>> properties without a lifecycle. Putting aside the naming issue,
> >>>> I
> >>>>>>> think the current model and hierarchy design is somewhat strange.
> >>>>> Storing
> >>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the same
> >>>>>> Catalog
> >>>>>>> with hierarchical identifiers like
> >>>> catalog-name.db-name.connection-name
> >>>>>>>>>>> raises the following questions:
> >>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
> >>>>> Connection
> >>>>>>> object ?
> >>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
> >>>> can't
> >>>>> we
> >>>>>>> use a Connection to create a MySQL Catalog?
> >>>>>>>>>>> 3. Regarding the connector usage examples given in this FLIP:
> >>>>>>>>>>> ```sql
> >>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
> >>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> >>>>>>>>>>> 3  WITH (
> >>>>>>>>>>> 4    'type' = 'jdbc',
> >>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
> >>>>>>> customer-db.example.com:3306/customerdb',
> >>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> >>>>>>>>>>> 7  );
> >>>>>>>>>>> 8
> >>>>>>>>>>> 9  CREATE TABLE customers (
> >>>>>>>>>>> 10   customer_id INT,
> >>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> >>>>>>>>>>> 12 ) WITH (
> >>>>>>>>>>> 13   'connector' = 'jdbc',
> >>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
> >>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> >>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> >>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
> >>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> >>>>>>>>>>> 19 );
> >>>>>>>>>>> ```
> >>>>>>>>>>> I see three issues from SQL semantics and Connector
> >>>> compatibility
> >>>>>>> perspectives:
> >>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object
> identifier
> >>>>> of
> >>>>>> a
> >>>>>>> CONNECTION defined in SQL. However, this identifier is referenced
> >>>>>>>>>>>     via a string value inside the table’s WITH clause, which
> >>>> feel
> >>>>>>> hack for me.
> >>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
> >>>>>>> `jdbc.connection` will confuse users because `connection.xx` maybe
> >>>>>> already
> >>>>>>> used as
> >>>>>>>>>>>  a prefix for existing configuration items.
> >>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
> >>>> options
> >>>>>>> need to be prefixed with `jdbc`, even they’re not related to
> >>>> Connection
> >>>>>>> properties?
> >>>>>>>>>>> This completely changes user habits — is it backward
> compatible?
> >>>>>>>>>>>  In my opinion, Connection should be a model independent of
> both
> >>>>>>> Catalog and Table, and can be referenced by all
> >>>> catalog/table/udf/model
> >>>>>>> object.
> >>>>>>>>>>> It should be managed by a Component such as a ConnectionManager
> >>>> to
> >>>>>>> enable reuse. For security purposes, authentication mechanisms
> could
> >>>>>>>>>>> be supported within the ConnectionManager.
> >>>>>>>>>>> Best,
> >>>>>>>>>>> Leonard
> >>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> >>>>>>>>>>>>
> >>>>>>>>>>>> Hi all,
> >>>>>>>>>>>>
> >>>>>>>>>>>> First of all, I think having a Connection resource is
> something
> >>>>>> that
> >>>>>>> will
> >>>>>>>>>>>> be beneficial for Apache Flink. I could see that being
> extended
> >>>>> in
> >>>>>>> the
> >>>>>>>>>>>> future to allow for easier secret handling [1].
> >>>>>>>>>>>> In my mental mind, I'm comparing this proposal against SQL/MED
> >>>>> from
> >>>>>>> the ISO
> >>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
> >>>> friendly
> >>>>>>> syntax
> >>>>>>>>>>>> though, looking at Postgres for example [3].
> >>>>>>>>>>>>
> >>>>>>>>>>>> I think it's a valid question if Connection should be
> >>>> considered
> >>>>>>> with a
> >>>>>>>>>>>> catalog or database-level scope. @Ryan can you share something
> >>>>>> more,
> >>>>>>> since
> >>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this case.
> >>>>> Which
> >>>>>>> is what
> >>>>>>>>>>>> we use internally to manage connection properties". It looks
> >>>> like
> >>>>>>> there
> >>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
> >>>>> (like,
> >>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
> >>>>>> database
> >>>>>>>>>>>> level).
> >>>>>>>>>>>>
> >>>>>>>>>>>> Also looking forward to Leonard's input.
> >>>>>>>>>>>>
> >>>>>>>>>>>> Best regards,
> >>>>>>>>>>>>
> >>>>>>>>>>>> Martijn
> >>>>>>>>>>>>
> >>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> >>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
> >>>>>>>>>>>> [3]
> >>>>> https://www.postgresql.org/docs/current/sql-createserver.html
> >>>>>>>>>>>>
> >>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xbjtdcq@gmail.com
> >
> >>>>>>> wrote:
> >>>>>>>>>>>>
> >>>>>>>>>>>>> Hey Mayank.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
> >>>> found
> >>>>>> some
> >>>>>>>>>>>>> issues which I think we
> >>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon boat
> >>>>>>> Festival,
> >>>>>>>>>>>>> could you kindly hold
> >>>>>>>>>>>>> on this thread? and we will back to continue the FLIP
> discuss.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Best,
> >>>>>>>>>>>>> Leonard
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
> >>>> 写道:
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Hi all,
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Motivation:
> >>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
> >>>> defining
> >>>>>>> endpoints
> >>>>>>>>>>>>>> and credentials in table configuration. This approach
> >>>> prevents
> >>>>>>>>>>>>> reusability
> >>>>>>>>>>>>>> of these connections and makes table definition less secure
> >>>> by
> >>>>>>> exposing
> >>>>>>>>>>>>>> sensitive information.
> >>>>>>>>>>>>>> We propose the introduction of a new "connection" resource
> in
> >>>>>>> Flink. This
> >>>>>>>>>>>>>> will be a pluggable resource configured with a remote
> >>>> endpoint
> >>>>>> and
> >>>>>>>>>>>>>> associated access key. Once defined, connections can be
> >>>> reused
> >>>>>>> across
> >>>>>>>>>>>>> table
> >>>>>>>>>>>>>> definitions, and eventually for model definition (as
> >>>> discussed
> >>>>> in
> >>>>>>>>>>>>> FLIP-437)
> >>>>>>>>>>>>>> for inference, enabling seamless and secure integration with
> >>>>>>> external
> >>>>>>>>>>>>>> systems.
> >>>>>>>>>>>>>> The connection resource will provide a new, optional way to
> >>>>>> manage
> >>>>>>>>>>>>> external
> >>>>>>>>>>>>>> connectivity in Flink. Existing methods for table
> definitions
> >>>>>> will
> >>>>>>> remain
> >>>>>>>>>>>>>> unchanged.
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Best Regards,
> >>>>>>>>>>>>>> Mayank Juneja
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> *Mayank Juneja*
> >>>>>> Product Manager | Data Streaming and AI
> >>>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>
> >>
>
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
Hi friends

I like the updated FLIP goals, that’s what I want. I’ve some feedback:

(1) Minor: Interface Hierarchy : Why doesn't WritableSecretStore extend SecretStore?
(2) Configurability of SECRET_FIELDS : Could the hardcoded SECRET_FIELDS in BasicConnectionFactory be made configurable (e.g., 'token' vs 'accessKey') for better connector compatibility? 
(3)Inconsistent Return Types : ConnectionFactory#resolveConnection returns SensitiveConnection, while BasicConnectionFactory#resolveConnection returns Map<String, String>. Should these be aligned? 
(4)Framework-level Resolution : +1 to Shengkai's point about having the framework (DynamicTableFactory) return complete options to reduce connector adaptation cost. 
(5)Secret ID Handling : When no encryption is needed, secretId is null (from secrets.isEmpty() ? null : secretStore.storeSecret(secrets)). This behavior should be explicitly documented in the interfaces.

Best,
Leonard

> 2025 7月 24 11:44,Shengkai Fang <fs...@gmail.com> 写道:
> 
> hi.
> 
> Sorry for the late reply. I just have some questions:
> 
> 1. Why SecretStoreFactory#open throws a CatalogException? I think the
> exteranl system can not handle this exception.
> 
> 2. I think we can also modify the create catalog ddl syntax.
> 
> ```
> CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
> WITH (
>    'type' = 'jdbc'
> );
> ```
> 
> 3. It seems the connector factory should merge the with options and
> connection options together and then create the source/sink. It's
> better that framework can merge all these options and connectors don't need
> any codes.
> 
> 4. Why we need to introduce ConnectionFactory? I think connection is like
> CatalogTable. It should hold the basic information and all information in
> the connection should be stored into secret store.
> 
> 
> Best,
> Shengkai
> 
> 
> Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:
> 
>> Hi Mayank,
>> 
>> Thanks for updating the FLIP and clearly documenting our discussion.
>> 
>> +1 for moving forward with the vote, unless there are objections from
>> others.
>> 
>> Cheers,
>> Timo
>> 
>> On 22.07.25 02:14, Mayank Juneja wrote:
>>> Hi Ryan and Austin,
>>> 
>>> Thanks for your suggestions. I've updated the FLIP with the following
>>> additional info -
>>> 
>>> 1. *table.secret-store.kind* key to register the SecretStore in a yaml
>> file
>>> 2. *updateSecret* method in WritableSecretStore interface
>>> 
>>> Thanks,
>>> Mayank
>>> 
>>> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
>>> austin.cawley@gmail.com> wrote:
>>> 
>>>> Hey all,
>>>> 
>>>> Thanks for the nice flip all! I’m just reading through – had one
>> question
>>>> on the ALTER CONNECTION implementation flow. Would it make sense for the
>>>> WritableSecretStore to expose a method for updating a secret by ID, so
>> it
>>>> can be done atomically? Else, would we need to call delete and create
>>>> again, potentially introducing concurrent resolution errors?
>>>> 
>>>> Best,
>>>> Austin
>>>> 
>>>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
>>>> <ry...@shopify.com.invalid> wrote:
>>>> 
>>>>> Hi Mayank,
>>>>> 
>>>>> Thanks for updating the FLIP. Overall it looks good to me.
>>>>> 
>>>>> One question I had related to how someone could choose the SecretStore
>>>> they
>>>>> want to use if they use something like the SQL Gateway as the
>> entrypoint
>>>> on
>>>>> top of a remote Session cluster. I don't see an explicit way to set the
>>>>> SecretStore in the FLIP.
>>>>> I assume we'll do it similar to the CatalogStore but I wanted to call
>>>> this
>>>>> out.
>>>>> 
>>>>> table.catalog-store.kind: filetable.catalog-store.file.path:
>>>>> file:///path/to/catalog/store/
>>>>> 
>>>>> Ryan van Huuksloot
>>>>> Staff Engineer, Infrastructure | Streaming Platform
>>>>> [image: Shopify]
>>>>> <
>> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
>>>>> 
>>>>> 
>>>>> 
>>>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
>> mayankjuneja27@gmail.com>
>>>>> wrote:
>>>>> 
>>>>>> Hi everyone,
>>>>>> 
>>>>>> Thanks for your valuable inputs. I have updated the FLIP with the
>> ideas
>>>>>> proposed earlier in the thread. Looking forward to your feedback.
>>>>>> https://cwiki.apache.org/confluence/x/cYroF
>>>>>> 
>>>>>> Best,
>>>>>> Mayank
>>>>>> 
>>>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com> wrote:
>>>>>> 
>>>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The new
>>>>>>> proposal looks well, +1 from my side.
>>>>>>> 
>>>>>>> Could you draft(update) current FLIP docs thus we can have some
>>>>> specific
>>>>>>> discussions later?
>>>>>>> 
>>>>>>> 
>>>>>>> Best,
>>>>>>> Leonard
>>>>>>> 
>>>>>>> 
>>>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
>>>>>>>> 
>>>>>>>> Hi everyone,
>>>>>>>> 
>>>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank, Hao
>>>>> and
>>>>>> I
>>>>>>> synced offline and came up we an improved proposal. Before we update
>>>>> the
>>>>>>> FLIP let me summarize the most important key facts that hopefully
>>>>> address
>>>>>>> most concerns:
>>>>>>>> 
>>>>>>>> 1) SecretStore
>>>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
>>>> highest
>>>>>>> level in TableEnvironment.
>>>>>>>> - SecretStore is initialized with options and potentially
>>>> environment
>>>>>>> variables. Including
>>>> EnvironmentSettings.withSecretStore(SecretStore).
>>>>>>>> - The SecretStore is pluggable and discovered using the regular
>>>>>>> factory-approach.
>>>>>>>> - For example, it could implement Azure Key Vault or other cloud
>>>>>>> provider secrets stores.
>>>>>>>> - Goal: Flink and Flink catalogs do not have to deal with sensitive
>>>>>> data.
>>>>>>>> 
>>>>>>>> 2) Connections
>>>>>>>> - Connections are catalog objects identified with 3-part
>>>> identifiers.
>>>>>>> 3-part identifiers are crucial for managability of larger projects
>>>> and
>>>>>>> align with existing catalog objects.
>>>>>>>> - They contain connection details, e.g. URL, query parameters, and
>>>>>> other
>>>>>>> configuration.
>>>>>>>> - They do not contain secrets, but only pointers to secrets in the
>>>>>>> SecretStore.
>>>>>>>> 
>>>>>>>> 3) Connection DDL
>>>>>>>> 
>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>>>>>>>>  ...
>>>>>>>> )
>>>>>>>> 
>>>>>>>> - Connection type is pluggable and discovered using the regular
>>>>>>> factory-approach.
>>>>>>>> - The factory extracts secrets and puts them into SecretStore.
>>>>>>>> - The factory only leaves non-confidential options left that can be
>>>>>>> stored in a catalog.
>>>>>>>> 
>>>>>>>> When executing:
>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>  'type' = 'basic',
>>>>>>>>  'url' = 'api.example.com',
>>>>>>>>  'username' = 'bob',
>>>>>>>>  'password' = 'xyz'
>>>>>>>> )
>>>>>>>> 
>>>>>>>> The catalog will receive something similar to:
>>>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>>>  'type' = 'basic',
>>>>>>>>  'url' = 'api.example.com',
>>>>>>>>  'secret.store' = 'azure-key-vault'
>>>>>>>>  'secret.id' = 'secretId'
>>>>>>>> )
>>>>>>>> 
>>>>>>>> - However, the exact property design is up to the connection
>>>> factory.
>>>>>>>> 
>>>>>>>> 4) Connection Usage
>>>>>>>> 
>>>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
>>>>>>>> 
>>>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
>>>>>>> similar to BigQuery.
>>>>>>>> - The connection will be provided in a table/model
>>>> provider/function
>>>>>>> definition factory.
>>>>>>>> 
>>>>>>>> 5) CatalogStore / Catalog Initialization
>>>>>>>> 
>>>>>>>> Catalog store or catalog can make use of SecretStore to retrieve
>>>>>> initial
>>>>>>> credentials for bootstrapping. All objects lower then catalog
>>>>>> store/catalog
>>>>>>> can then use connections. If you think we still need system level
>>>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH
>>>>> (..)
>>>>>>> similar to SYSTEM functions directly store in a ConnectioManager in
>>>>>>> TableEnvironment. But for now I would suggest to start simple with
>>>>>>> per-catalog connections and later evolve the design.
>>>>>>>> 
>>>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly not
>>>> an
>>>>>>> expert on it. This is why we should try to push the problem to
>>>> existing
>>>>>>> solutions and don't start storing secrets in Flink in any way. Thus,
>>>>> the
>>>>>>> interfaces will be defined very generic.
>>>>>>>> 
>>>>>>>> Looking forward to your feedback.
>>>>>>>> 
>>>>>>>> Cheers,
>>>>>>>> Timo
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
>>>>>>>>> Thanks  Timo for joining this thread.
>>>>>>>>> I agree that this feature is needed by the community; the current
>>>>>>> disagreement is only about the implementation method or solution.
>>>>>>>>> Your thoughts looks generally good to me, looking forward to your
>>>>>>> proposal.
>>>>>>>>> Best,
>>>>>>>>> Leonard
>>>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>>> 
>>>>>>>>>> Hi everyone,
>>>>>>>>>> 
>>>>>>>>>> thanks for this healthy discussion. Looking at high number of
>>>>>>> participants, it looks like we definitely want this feature. We just
>>>>> need
>>>>>>> to figure out the "how".
>>>>>>>>>> 
>>>>>>>>>> This reminds me very much of the discussion we had for CREATE
>>>>>>> FUNCTION. There, we discussed whether functions should be named
>>>>> globally
>>>>>> or
>>>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
>>>>>> FUNCTION`
>>>>>>> and `CREATE FUNCTION`, satisfying both the data platform team of an
>>>>>>> organization (which might provide system functions) and individual
>>>> data
>>>>>>> teams or use cases (scoped by catalog/database).
>>>>>>>>>> 
>>>>>>>>>> Looking at other modern vendors like Snowflake there is SECRET
>>>>>> (scoped
>>>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So also
>>>>> other
>>>>>>> vendors offer global and per-team / per-use case connections details.
>>>>>>>>>> 
>>>>>>>>>> In general, I think fitting connections into the existing
>>>> concepts
>>>>>> for
>>>>>>> catalog objects (with three-part identifier) makes managing them
>>>>> easier.
>>>>>>> But I also see the need for global defaults.
>>>>>>>>>> 
>>>>>>>>>> Btw keep in mind that a catalog implementation should only store
>>>>>>> metadata. Similar how a CatalogTable doesn't store the actual data, a
>>>>>>> CatalogConnection should not store the credentials. It should only
>>>>> offer
>>>>>> a
>>>>>>> factory that allows for storing and retrieving them. In real world
>>>>>>> scenarios a factory is most likely backed by a product like Azure Key
>>>>>> Vault.
>>>>>>>>>> 
>>>>>>>>>> So code-wise having a ConnectionManager that behaves similar to
>>>>>>> FunctionManager sounds reasonable.
>>>>>>>>>> 
>>>>>>>>>> +1 for having special syntax instead of using properties. This
>>>>> allows
>>>>>>> to access connections in tables, models, functions. And catalogs, if
>>>> we
>>>>>>> agree to have global ones as well.
>>>>>>>>>> 
>>>>>>>>>> What do you think?
>>>>>>>>>> 
>>>>>>>>>> Let me spend some more thoughts on this and come back with a
>>>>> concrete
>>>>>>> proposal by early next week.
>>>>>>>>>> 
>>>>>>>>>> Cheers,
>>>>>>>>>> Timo
>>>>>>>>>> 
>>>>>>>>>> [1]
>>>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
>>>>>>>>>> [2]
>>>>>>> 
>>>> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>>>>>>>>>> 
>>>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
>>>>>>>>>>> Hey,Mayank
>>>>>>>>>>> Please see my feedback as following:
>>>>>>>>>>> 1. One of the motivations of this FLIP is to improve security.
>>>>>>> However, the current design stores all connection information in the
>>>>>>> catalog,
>>>>>>>>>>> and each Flink SQL job reads from the catalog during
>>>> compilation.
>>>>>> The
>>>>>>> connection information is passed between SQL Gateway and the
>>>>>>>>>>> catalog in plaintext, which actually introduces new security
>>>>> risks.
>>>>>>>>>>> 2. The name "Connection" should be changed to something like
>>>>>>> ConnectionSpec to clearly indicate that it is a object containing
>>>> only
>>>>>>> static
>>>>>>>>>>> properties without a lifecycle. Putting aside the naming issue,
>>>> I
>>>>>>> think the current model and hierarchy design is somewhat strange.
>>>>> Storing
>>>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the same
>>>>>> Catalog
>>>>>>> with hierarchical identifiers like
>>>> catalog-name.db-name.connection-name
>>>>>>>>>>> raises the following questions:
>>>>>>>>>>> (1) What is the purpose of this hierarchical structure of
>>>>> Connection
>>>>>>> object ?
>>>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
>>>> can't
>>>>> we
>>>>>>> use a Connection to create a MySQL Catalog?
>>>>>>>>>>> 3. Regarding the connector usage examples given in this FLIP:
>>>>>>>>>>> ```sql
>>>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
>>>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>>>>>>>>>>> 3  WITH (
>>>>>>>>>>> 4    'type' = 'jdbc',
>>>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
>>>>>>> customer-db.example.com:3306/customerdb',
>>>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>>>>>>>>>>> 7  );
>>>>>>>>>>> 8
>>>>>>>>>>> 9  CREATE TABLE customers (
>>>>>>>>>>> 10   customer_id INT,
>>>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>>>>>>>>>>> 12 ) WITH (
>>>>>>>>>>> 13   'connector' = 'jdbc',
>>>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
>>>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>>>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>>>>>>>>>>> 17   'jdbc.table-name' = 'customers',
>>>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>>>>>>>>>>> 19 );
>>>>>>>>>>> ```
>>>>>>>>>>> I see three issues from SQL semantics and Connector
>>>> compatibility
>>>>>>> perspectives:
>>>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object identifier
>>>>> of
>>>>>> a
>>>>>>> CONNECTION defined in SQL. However, this identifier is referenced
>>>>>>>>>>>     via a string value inside the table’s WITH clause, which
>>>> feel
>>>>>>> hack for me.
>>>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
>>>>>>> `jdbc.connection` will confuse users because `connection.xx` maybe
>>>>>> already
>>>>>>> used as
>>>>>>>>>>>  a prefix for existing configuration items.
>>>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
>>>> options
>>>>>>> need to be prefixed with `jdbc`, even they’re not related to
>>>> Connection
>>>>>>> properties?
>>>>>>>>>>> This completely changes user habits — is it backward compatible?
>>>>>>>>>>>  In my opinion, Connection should be a model independent of both
>>>>>>> Catalog and Table, and can be referenced by all
>>>> catalog/table/udf/model
>>>>>>> object.
>>>>>>>>>>> It should be managed by a Component such as a ConnectionManager
>>>> to
>>>>>>> enable reuse. For security purposes, authentication mechanisms could
>>>>>>>>>>> be supported within the ConnectionManager.
>>>>>>>>>>> Best,
>>>>>>>>>>> Leonard
>>>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
>>>>>>>>>>>> 
>>>>>>>>>>>> Hi all,
>>>>>>>>>>>> 
>>>>>>>>>>>> First of all, I think having a Connection resource is something
>>>>>> that
>>>>>>> will
>>>>>>>>>>>> be beneficial for Apache Flink. I could see that being extended
>>>>> in
>>>>>>> the
>>>>>>>>>>>> future to allow for easier secret handling [1].
>>>>>>>>>>>> In my mental mind, I'm comparing this proposal against SQL/MED
>>>>> from
>>>>>>> the ISO
>>>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
>>>> friendly
>>>>>>> syntax
>>>>>>>>>>>> though, looking at Postgres for example [3].
>>>>>>>>>>>> 
>>>>>>>>>>>> I think it's a valid question if Connection should be
>>>> considered
>>>>>>> with a
>>>>>>>>>>>> catalog or database-level scope. @Ryan can you share something
>>>>>> more,
>>>>>>> since
>>>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this case.
>>>>> Which
>>>>>>> is what
>>>>>>>>>>>> we use internally to manage connection properties". It looks
>>>> like
>>>>>>> there
>>>>>>>>>>>> isn't a strong favourable approach looking at other vendors
>>>>> (like,
>>>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
>>>>>> database
>>>>>>>>>>>> level).
>>>>>>>>>>>> 
>>>>>>>>>>>> Also looking forward to Leonard's input.
>>>>>>>>>>>> 
>>>>>>>>>>>> Best regards,
>>>>>>>>>>>> 
>>>>>>>>>>>> Martijn
>>>>>>>>>>>> 
>>>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
>>>>>>>>>>>> [3]
>>>>> https://www.postgresql.org/docs/current/sql-createserver.html
>>>>>>>>>>>> 
>>>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com>
>>>>>>> wrote:
>>>>>>>>>>>> 
>>>>>>>>>>>>> Hey Mayank.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
>>>> found
>>>>>> some
>>>>>>>>>>>>> issues which I think we
>>>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon boat
>>>>>>> Festival,
>>>>>>>>>>>>> could you kindly hold
>>>>>>>>>>>>> on this thread? and we will back to continue the FLIP discuss.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Best,
>>>>>>>>>>>>> Leonard
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
>>>> 写道:
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Motivation:
>>>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
>>>> defining
>>>>>>> endpoints
>>>>>>>>>>>>>> and credentials in table configuration. This approach
>>>> prevents
>>>>>>>>>>>>> reusability
>>>>>>>>>>>>>> of these connections and makes table definition less secure
>>>> by
>>>>>>> exposing
>>>>>>>>>>>>>> sensitive information.
>>>>>>>>>>>>>> We propose the introduction of a new "connection" resource in
>>>>>>> Flink. This
>>>>>>>>>>>>>> will be a pluggable resource configured with a remote
>>>> endpoint
>>>>>> and
>>>>>>>>>>>>>> associated access key. Once defined, connections can be
>>>> reused
>>>>>>> across
>>>>>>>>>>>>> table
>>>>>>>>>>>>>> definitions, and eventually for model definition (as
>>>> discussed
>>>>> in
>>>>>>>>>>>>> FLIP-437)
>>>>>>>>>>>>>> for inference, enabling seamless and secure integration with
>>>>>>> external
>>>>>>>>>>>>>> systems.
>>>>>>>>>>>>>> The connection resource will provide a new, optional way to
>>>>>> manage
>>>>>>>>>>>>> external
>>>>>>>>>>>>>> connectivity in Flink. Existing methods for table definitions
>>>>>> will
>>>>>>> remain
>>>>>>>>>>>>>> unchanged.
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>>>>>>>> 
>>>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>>>> Mayank Juneja
>>>>>>>>>>>>> 
>>>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> *Mayank Juneja*
>>>>>> Product Manager | Data Streaming and AI
>>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>> 
>> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Shengkai Fang <fs...@gmail.com>.
hi.

Sorry for the late reply. I just have some questions:

1. Why SecretStoreFactory#open throws a CatalogException? I think the
exteranl system can not handle this exception.

2. I think we can also modify the create catalog ddl syntax.

```
CREATE CATALOG cat USING CONNECTION mycat.mydb.mysql_prod
WITH (
    'type' = 'jdbc'
);
```

3. It seems the connector factory should merge the with options and
connection options together and then create the source/sink. It's
better that framework can merge all these options and connectors don't need
any codes.

4. Why we need to introduce ConnectionFactory? I think connection is like
CatalogTable. It should hold the basic information and all information in
the connection should be stored into secret store.


Best,
Shengkai


Timo Walther <tw...@apache.org> 于2025年7月22日周二 22:04写道:

> Hi Mayank,
>
> Thanks for updating the FLIP and clearly documenting our discussion.
>
> +1 for moving forward with the vote, unless there are objections from
> others.
>
> Cheers,
> Timo
>
> On 22.07.25 02:14, Mayank Juneja wrote:
> > Hi Ryan and Austin,
> >
> > Thanks for your suggestions. I've updated the FLIP with the following
> > additional info -
> >
> > 1. *table.secret-store.kind* key to register the SecretStore in a yaml
> file
> > 2. *updateSecret* method in WritableSecretStore interface
> >
> > Thanks,
> > Mayank
> >
> > On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
> > austin.cawley@gmail.com> wrote:
> >
> >> Hey all,
> >>
> >> Thanks for the nice flip all! I’m just reading through – had one
> question
> >> on the ALTER CONNECTION implementation flow. Would it make sense for the
> >> WritableSecretStore to expose a method for updating a secret by ID, so
> it
> >> can be done atomically? Else, would we need to call delete and create
> >> again, potentially introducing concurrent resolution errors?
> >>
> >> Best,
> >> Austin
> >>
> >> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
> >> <ry...@shopify.com.invalid> wrote:
> >>
> >>> Hi Mayank,
> >>>
> >>> Thanks for updating the FLIP. Overall it looks good to me.
> >>>
> >>> One question I had related to how someone could choose the SecretStore
> >> they
> >>> want to use if they use something like the SQL Gateway as the
> entrypoint
> >> on
> >>> top of a remote Session cluster. I don't see an explicit way to set the
> >>> SecretStore in the FLIP.
> >>> I assume we'll do it similar to the CatalogStore but I wanted to call
> >> this
> >>> out.
> >>>
> >>> table.catalog-store.kind: filetable.catalog-store.file.path:
> >>> file:///path/to/catalog/store/
> >>>
> >>> Ryan van Huuksloot
> >>> Staff Engineer, Infrastructure | Streaming Platform
> >>> [image: Shopify]
> >>> <
> https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
> >>>
> >>>
> >>>
> >>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <
> mayankjuneja27@gmail.com>
> >>> wrote:
> >>>
> >>>> Hi everyone,
> >>>>
> >>>> Thanks for your valuable inputs. I have updated the FLIP with the
> ideas
> >>>> proposed earlier in the thread. Looking forward to your feedback.
> >>>> https://cwiki.apache.org/confluence/x/cYroF
> >>>>
> >>>> Best,
> >>>> Mayank
> >>>>
> >>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com> wrote:
> >>>>
> >>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The new
> >>>>> proposal looks well, +1 from my side.
> >>>>>
> >>>>> Could you draft(update) current FLIP docs thus we can have some
> >>> specific
> >>>>> discussions later?
> >>>>>
> >>>>>
> >>>>> Best,
> >>>>> Leonard
> >>>>>
> >>>>>
> >>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> >>>>>>
> >>>>>> Hi everyone,
> >>>>>>
> >>>>>> sorry for the late reply, feature freeze kept me busy. Mayank, Hao
> >>> and
> >>>> I
> >>>>> synced offline and came up we an improved proposal. Before we update
> >>> the
> >>>>> FLIP let me summarize the most important key facts that hopefully
> >>> address
> >>>>> most concerns:
> >>>>>>
> >>>>>> 1) SecretStore
> >>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
> >> highest
> >>>>> level in TableEnvironment.
> >>>>>> - SecretStore is initialized with options and potentially
> >> environment
> >>>>> variables. Including
> >> EnvironmentSettings.withSecretStore(SecretStore).
> >>>>>> - The SecretStore is pluggable and discovered using the regular
> >>>>> factory-approach.
> >>>>>> - For example, it could implement Azure Key Vault or other cloud
> >>>>> provider secrets stores.
> >>>>>> - Goal: Flink and Flink catalogs do not have to deal with sensitive
> >>>> data.
> >>>>>>
> >>>>>> 2) Connections
> >>>>>> - Connections are catalog objects identified with 3-part
> >> identifiers.
> >>>>> 3-part identifiers are crucial for managability of larger projects
> >> and
> >>>>> align with existing catalog objects.
> >>>>>> - They contain connection details, e.g. URL, query parameters, and
> >>>> other
> >>>>> configuration.
> >>>>>> - They do not contain secrets, but only pointers to secrets in the
> >>>>> SecretStore.
> >>>>>>
> >>>>>> 3) Connection DDL
> >>>>>>
> >>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>   'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> >>>>>>   ...
> >>>>>> )
> >>>>>>
> >>>>>> - Connection type is pluggable and discovered using the regular
> >>>>> factory-approach.
> >>>>>> - The factory extracts secrets and puts them into SecretStore.
> >>>>>> - The factory only leaves non-confidential options left that can be
> >>>>> stored in a catalog.
> >>>>>>
> >>>>>> When executing:
> >>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>   'type' = 'basic',
> >>>>>>   'url' = 'api.example.com',
> >>>>>>   'username' = 'bob',
> >>>>>>   'password' = 'xyz'
> >>>>>> )
> >>>>>>
> >>>>>> The catalog will receive something similar to:
> >>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >>>>>>   'type' = 'basic',
> >>>>>>   'url' = 'api.example.com',
> >>>>>>   'secret.store' = 'azure-key-vault'
> >>>>>>   'secret.id' = 'secretId'
> >>>>>> )
> >>>>>>
> >>>>>> - However, the exact property design is up to the connection
> >> factory.
> >>>>>>
> >>>>>> 4) Connection Usage
> >>>>>>
> >>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> >>>>>>
> >>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
> >>>>> similar to BigQuery.
> >>>>>> - The connection will be provided in a table/model
> >> provider/function
> >>>>> definition factory.
> >>>>>>
> >>>>>> 5) CatalogStore / Catalog Initialization
> >>>>>>
> >>>>>> Catalog store or catalog can make use of SecretStore to retrieve
> >>>> initial
> >>>>> credentials for bootstrapping. All objects lower then catalog
> >>>> store/catalog
> >>>>> can then use connections. If you think we still need system level
> >>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH
> >>> (..)
> >>>>> similar to SYSTEM functions directly store in a ConnectioManager in
> >>>>> TableEnvironment. But for now I would suggest to start simple with
> >>>>> per-catalog connections and later evolve the design.
> >>>>>>
> >>>>>> Dealing with secrets is a very sensitive topic and I'm clearly not
> >> an
> >>>>> expert on it. This is why we should try to push the problem to
> >> existing
> >>>>> solutions and don't start storing secrets in Flink in any way. Thus,
> >>> the
> >>>>> interfaces will be defined very generic.
> >>>>>>
> >>>>>> Looking forward to your feedback.
> >>>>>>
> >>>>>> Cheers,
> >>>>>> Timo
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On 09.06.25 04:01, Leonard Xu wrote:
> >>>>>>> Thanks  Timo for joining this thread.
> >>>>>>> I agree that this feature is needed by the community; the current
> >>>>> disagreement is only about the implementation method or solution.
> >>>>>>> Your thoughts looks generally good to me, looking forward to your
> >>>>> proposal.
> >>>>>>> Best,
> >>>>>>> Leonard
> >>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> >>>>>>>>
> >>>>>>>> Hi everyone,
> >>>>>>>>
> >>>>>>>> thanks for this healthy discussion. Looking at high number of
> >>>>> participants, it looks like we definitely want this feature. We just
> >>> need
> >>>>> to figure out the "how".
> >>>>>>>>
> >>>>>>>> This reminds me very much of the discussion we had for CREATE
> >>>>> FUNCTION. There, we discussed whether functions should be named
> >>> globally
> >>>> or
> >>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
> >>>> FUNCTION`
> >>>>> and `CREATE FUNCTION`, satisfying both the data platform team of an
> >>>>> organization (which might provide system functions) and individual
> >> data
> >>>>> teams or use cases (scoped by catalog/database).
> >>>>>>>>
> >>>>>>>> Looking at other modern vendors like Snowflake there is SECRET
> >>>> (scoped
> >>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So also
> >>> other
> >>>>> vendors offer global and per-team / per-use case connections details.
> >>>>>>>>
> >>>>>>>> In general, I think fitting connections into the existing
> >> concepts
> >>>> for
> >>>>> catalog objects (with three-part identifier) makes managing them
> >>> easier.
> >>>>> But I also see the need for global defaults.
> >>>>>>>>
> >>>>>>>> Btw keep in mind that a catalog implementation should only store
> >>>>> metadata. Similar how a CatalogTable doesn't store the actual data, a
> >>>>> CatalogConnection should not store the credentials. It should only
> >>> offer
> >>>> a
> >>>>> factory that allows for storing and retrieving them. In real world
> >>>>> scenarios a factory is most likely backed by a product like Azure Key
> >>>> Vault.
> >>>>>>>>
> >>>>>>>> So code-wise having a ConnectionManager that behaves similar to
> >>>>> FunctionManager sounds reasonable.
> >>>>>>>>
> >>>>>>>> +1 for having special syntax instead of using properties. This
> >>> allows
> >>>>> to access connections in tables, models, functions. And catalogs, if
> >> we
> >>>>> agree to have global ones as well.
> >>>>>>>>
> >>>>>>>> What do you think?
> >>>>>>>>
> >>>>>>>> Let me spend some more thoughts on this and come back with a
> >>> concrete
> >>>>> proposal by early next week.
> >>>>>>>>
> >>>>>>>> Cheers,
> >>>>>>>> Timo
> >>>>>>>>
> >>>>>>>> [1]
> >> https://docs.snowflake.com/en/sql-reference/sql/create-secret
> >>>>>>>> [2]
> >>>>>
> >> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> >>>>>>>>
> >>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
> >>>>>>>>> Hey,Mayank
> >>>>>>>>> Please see my feedback as following:
> >>>>>>>>> 1. One of the motivations of this FLIP is to improve security.
> >>>>> However, the current design stores all connection information in the
> >>>>> catalog,
> >>>>>>>>> and each Flink SQL job reads from the catalog during
> >> compilation.
> >>>> The
> >>>>> connection information is passed between SQL Gateway and the
> >>>>>>>>> catalog in plaintext, which actually introduces new security
> >>> risks.
> >>>>>>>>> 2. The name "Connection" should be changed to something like
> >>>>> ConnectionSpec to clearly indicate that it is a object containing
> >> only
> >>>>> static
> >>>>>>>>> properties without a lifecycle. Putting aside the naming issue,
> >> I
> >>>>> think the current model and hierarchy design is somewhat strange.
> >>> Storing
> >>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the same
> >>>> Catalog
> >>>>> with hierarchical identifiers like
> >> catalog-name.db-name.connection-name
> >>>>>>>>> raises the following questions:
> >>>>>>>>> (1) What is the purpose of this hierarchical structure of
> >>> Connection
> >>>>> object ?
> >>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
> >> can't
> >>> we
> >>>>> use a Connection to create a MySQL Catalog?
> >>>>>>>>> 3. Regarding the connector usage examples given in this FLIP:
> >>>>>>>>> ```sql
> >>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
> >>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> >>>>>>>>> 3  WITH (
> >>>>>>>>> 4    'type' = 'jdbc',
> >>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
> >>>>> customer-db.example.com:3306/customerdb',
> >>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> >>>>>>>>> 7  );
> >>>>>>>>> 8
> >>>>>>>>> 9  CREATE TABLE customers (
> >>>>>>>>> 10   customer_id INT,
> >>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> >>>>>>>>> 12 ) WITH (
> >>>>>>>>> 13   'connector' = 'jdbc',
> >>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
> >>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> >>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> >>>>>>>>> 17   'jdbc.table-name' = 'customers',
> >>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> >>>>>>>>> 19 );
> >>>>>>>>> ```
> >>>>>>>>> I see three issues from SQL semantics and Connector
> >> compatibility
> >>>>> perspectives:
> >>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object identifier
> >>> of
> >>>> a
> >>>>> CONNECTION defined in SQL. However, this identifier is referenced
> >>>>>>>>>      via a string value inside the table’s WITH clause, which
> >> feel
> >>>>> hack for me.
> >>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
> >>>>> `jdbc.connection` will confuse users because `connection.xx` maybe
> >>>> already
> >>>>> used as
> >>>>>>>>>   a prefix for existing configuration items.
> >>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
> >> options
> >>>>> need to be prefixed with `jdbc`, even they’re not related to
> >> Connection
> >>>>> properties?
> >>>>>>>>> This completely changes user habits — is it backward compatible?
> >>>>>>>>>   In my opinion, Connection should be a model independent of both
> >>>>> Catalog and Table, and can be referenced by all
> >> catalog/table/udf/model
> >>>>> object.
> >>>>>>>>> It should be managed by a Component such as a ConnectionManager
> >> to
> >>>>> enable reuse. For security purposes, authentication mechanisms could
> >>>>>>>>> be supported within the ConnectionManager.
> >>>>>>>>> Best,
> >>>>>>>>> Leonard
> >>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> >>>>>>>>>>
> >>>>>>>>>> Hi all,
> >>>>>>>>>>
> >>>>>>>>>> First of all, I think having a Connection resource is something
> >>>> that
> >>>>> will
> >>>>>>>>>> be beneficial for Apache Flink. I could see that being extended
> >>> in
> >>>>> the
> >>>>>>>>>> future to allow for easier secret handling [1].
> >>>>>>>>>> In my mental mind, I'm comparing this proposal against SQL/MED
> >>> from
> >>>>> the ISO
> >>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
> >> friendly
> >>>>> syntax
> >>>>>>>>>> though, looking at Postgres for example [3].
> >>>>>>>>>>
> >>>>>>>>>> I think it's a valid question if Connection should be
> >> considered
> >>>>> with a
> >>>>>>>>>> catalog or database-level scope. @Ryan can you share something
> >>>> more,
> >>>>> since
> >>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this case.
> >>> Which
> >>>>> is what
> >>>>>>>>>> we use internally to manage connection properties". It looks
> >> like
> >>>>> there
> >>>>>>>>>> isn't a strong favourable approach looking at other vendors
> >>> (like,
> >>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
> >>>> database
> >>>>>>>>>> level).
> >>>>>>>>>>
> >>>>>>>>>> Also looking forward to Leonard's input.
> >>>>>>>>>>
> >>>>>>>>>> Best regards,
> >>>>>>>>>>
> >>>>>>>>>> Martijn
> >>>>>>>>>>
> >>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> >>>>>>>>>> [2] https://www.iso.org/standard/84804.html
> >>>>>>>>>> [3]
> >>> https://www.postgresql.org/docs/current/sql-createserver.html
> >>>>>>>>>>
> >>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com>
> >>>>> wrote:
> >>>>>>>>>>
> >>>>>>>>>>> Hey Mayank.
> >>>>>>>>>>>
> >>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
> >> found
> >>>> some
> >>>>>>>>>>> issues which I think we
> >>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon boat
> >>>>> Festival,
> >>>>>>>>>>> could you kindly hold
> >>>>>>>>>>> on this thread? and we will back to continue the FLIP discuss.
> >>>>>>>>>>>
> >>>>>>>>>>> Best,
> >>>>>>>>>>> Leonard
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
> >> 写道:
> >>>>>>>>>>>>
> >>>>>>>>>>>> Hi all,
> >>>>>>>>>>>>
> >>>>>>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> >>>>>>>>>>>>
> >>>>>>>>>>>> Motivation:
> >>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
> >> defining
> >>>>> endpoints
> >>>>>>>>>>>> and credentials in table configuration. This approach
> >> prevents
> >>>>>>>>>>> reusability
> >>>>>>>>>>>> of these connections and makes table definition less secure
> >> by
> >>>>> exposing
> >>>>>>>>>>>> sensitive information.
> >>>>>>>>>>>> We propose the introduction of a new "connection" resource in
> >>>>> Flink. This
> >>>>>>>>>>>> will be a pluggable resource configured with a remote
> >> endpoint
> >>>> and
> >>>>>>>>>>>> associated access key. Once defined, connections can be
> >> reused
> >>>>> across
> >>>>>>>>>>> table
> >>>>>>>>>>>> definitions, and eventually for model definition (as
> >> discussed
> >>> in
> >>>>>>>>>>> FLIP-437)
> >>>>>>>>>>>> for inference, enabling seamless and secure integration with
> >>>>> external
> >>>>>>>>>>>> systems.
> >>>>>>>>>>>> The connection resource will provide a new, optional way to
> >>>> manage
> >>>>>>>>>>> external
> >>>>>>>>>>>> connectivity in Flink. Existing methods for table definitions
> >>>> will
> >>>>> remain
> >>>>>>>>>>>> unchanged.
> >>>>>>>>>>>>
> >>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>>>>>>>
> >>>>>>>>>>>> Best Regards,
> >>>>>>>>>>>> Mayank Juneja
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>> --
> >>>> *Mayank Juneja*
> >>>> Product Manager | Data Streaming and AI
> >>>>
> >>>
> >>
> >
> >
>
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Timo Walther <tw...@apache.org>.
Hi Mayank,

Thanks for updating the FLIP and clearly documenting our discussion.

+1 for moving forward with the vote, unless there are objections from 
others.

Cheers,
Timo

On 22.07.25 02:14, Mayank Juneja wrote:
> Hi Ryan and Austin,
> 
> Thanks for your suggestions. I've updated the FLIP with the following
> additional info -
> 
> 1. *table.secret-store.kind* key to register the SecretStore in a yaml file
> 2. *updateSecret* method in WritableSecretStore interface
> 
> Thanks,
> Mayank
> 
> On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
> austin.cawley@gmail.com> wrote:
> 
>> Hey all,
>>
>> Thanks for the nice flip all! I’m just reading through – had one question
>> on the ALTER CONNECTION implementation flow. Would it make sense for the
>> WritableSecretStore to expose a method for updating a secret by ID, so it
>> can be done atomically? Else, would we need to call delete and create
>> again, potentially introducing concurrent resolution errors?
>>
>> Best,
>> Austin
>>
>> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
>> <ry...@shopify.com.invalid> wrote:
>>
>>> Hi Mayank,
>>>
>>> Thanks for updating the FLIP. Overall it looks good to me.
>>>
>>> One question I had related to how someone could choose the SecretStore
>> they
>>> want to use if they use something like the SQL Gateway as the entrypoint
>> on
>>> top of a remote Session cluster. I don't see an explicit way to set the
>>> SecretStore in the FLIP.
>>> I assume we'll do it similar to the CatalogStore but I wanted to call
>> this
>>> out.
>>>
>>> table.catalog-store.kind: filetable.catalog-store.file.path:
>>> file:///path/to/catalog/store/
>>>
>>> Ryan van Huuksloot
>>> Staff Engineer, Infrastructure | Streaming Platform
>>> [image: Shopify]
>>> <https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
>>>
>>>
>>>
>>> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <ma...@gmail.com>
>>> wrote:
>>>
>>>> Hi everyone,
>>>>
>>>> Thanks for your valuable inputs. I have updated the FLIP with the ideas
>>>> proposed earlier in the thread. Looking forward to your feedback.
>>>> https://cwiki.apache.org/confluence/x/cYroF
>>>>
>>>> Best,
>>>> Mayank
>>>>
>>>> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com> wrote:
>>>>
>>>>> Quick response, thanks Mayank, Hao and Timo for the effort.  The new
>>>>> proposal looks well, +1 from my side.
>>>>>
>>>>> Could you draft(update) current FLIP docs thus we can have some
>>> specific
>>>>> discussions later?
>>>>>
>>>>>
>>>>> Best,
>>>>> Leonard
>>>>>
>>>>>
>>>>>> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
>>>>>>
>>>>>> Hi everyone,
>>>>>>
>>>>>> sorry for the late reply, feature freeze kept me busy. Mayank, Hao
>>> and
>>>> I
>>>>> synced offline and came up we an improved proposal. Before we update
>>> the
>>>>> FLIP let me summarize the most important key facts that hopefully
>>> address
>>>>> most concerns:
>>>>>>
>>>>>> 1) SecretStore
>>>>>> - Similar to CatalogStore, we introduce a SecretStore as the
>> highest
>>>>> level in TableEnvironment.
>>>>>> - SecretStore is initialized with options and potentially
>> environment
>>>>> variables. Including
>> EnvironmentSettings.withSecretStore(SecretStore).
>>>>>> - The SecretStore is pluggable and discovered using the regular
>>>>> factory-approach.
>>>>>> - For example, it could implement Azure Key Vault or other cloud
>>>>> provider secrets stores.
>>>>>> - Goal: Flink and Flink catalogs do not have to deal with sensitive
>>>> data.
>>>>>>
>>>>>> 2) Connections
>>>>>> - Connections are catalog objects identified with 3-part
>> identifiers.
>>>>> 3-part identifiers are crucial for managability of larger projects
>> and
>>>>> align with existing catalog objects.
>>>>>> - They contain connection details, e.g. URL, query parameters, and
>>>> other
>>>>> configuration.
>>>>>> - They do not contain secrets, but only pointers to secrets in the
>>>>> SecretStore.
>>>>>>
>>>>>> 3) Connection DDL
>>>>>>
>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>   'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>>>>>>   ...
>>>>>> )
>>>>>>
>>>>>> - Connection type is pluggable and discovered using the regular
>>>>> factory-approach.
>>>>>> - The factory extracts secrets and puts them into SecretStore.
>>>>>> - The factory only leaves non-confidential options left that can be
>>>>> stored in a catalog.
>>>>>>
>>>>>> When executing:
>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>   'type' = 'basic',
>>>>>>   'url' = 'api.example.com',
>>>>>>   'username' = 'bob',
>>>>>>   'password' = 'xyz'
>>>>>> )
>>>>>>
>>>>>> The catalog will receive something similar to:
>>>>>> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>>>>>>   'type' = 'basic',
>>>>>>   'url' = 'api.example.com',
>>>>>>   'secret.store' = 'azure-key-vault'
>>>>>>   'secret.id' = 'secretId'
>>>>>> )
>>>>>>
>>>>>> - However, the exact property design is up to the connection
>> factory.
>>>>>>
>>>>>> 4) Connection Usage
>>>>>>
>>>>>> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
>>>>>>
>>>>>> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
>>>>> similar to BigQuery.
>>>>>> - The connection will be provided in a table/model
>> provider/function
>>>>> definition factory.
>>>>>>
>>>>>> 5) CatalogStore / Catalog Initialization
>>>>>>
>>>>>> Catalog store or catalog can make use of SecretStore to retrieve
>>>> initial
>>>>> credentials for bootstrapping. All objects lower then catalog
>>>> store/catalog
>>>>> can then use connections. If you think we still need system level
>>>>> connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH
>>> (..)
>>>>> similar to SYSTEM functions directly store in a ConnectioManager in
>>>>> TableEnvironment. But for now I would suggest to start simple with
>>>>> per-catalog connections and later evolve the design.
>>>>>>
>>>>>> Dealing with secrets is a very sensitive topic and I'm clearly not
>> an
>>>>> expert on it. This is why we should try to push the problem to
>> existing
>>>>> solutions and don't start storing secrets in Flink in any way. Thus,
>>> the
>>>>> interfaces will be defined very generic.
>>>>>>
>>>>>> Looking forward to your feedback.
>>>>>>
>>>>>> Cheers,
>>>>>> Timo
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 09.06.25 04:01, Leonard Xu wrote:
>>>>>>> Thanks  Timo for joining this thread.
>>>>>>> I agree that this feature is needed by the community; the current
>>>>> disagreement is only about the implementation method or solution.
>>>>>>> Your thoughts looks generally good to me, looking forward to your
>>>>> proposal.
>>>>>>> Best,
>>>>>>> Leonard
>>>>>>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>>>>>>>>
>>>>>>>> Hi everyone,
>>>>>>>>
>>>>>>>> thanks for this healthy discussion. Looking at high number of
>>>>> participants, it looks like we definitely want this feature. We just
>>> need
>>>>> to figure out the "how".
>>>>>>>>
>>>>>>>> This reminds me very much of the discussion we had for CREATE
>>>>> FUNCTION. There, we discussed whether functions should be named
>>> globally
>>>> or
>>>>> catalog-specific. In the end, we decided for both `CREATE SYSTEM
>>>> FUNCTION`
>>>>> and `CREATE FUNCTION`, satisfying both the data platform team of an
>>>>> organization (which might provide system functions) and individual
>> data
>>>>> teams or use cases (scoped by catalog/database).
>>>>>>>>
>>>>>>>> Looking at other modern vendors like Snowflake there is SECRET
>>>> (scoped
>>>>> to schema) [1] and API INTEGRATION [2] (scoped to account). So also
>>> other
>>>>> vendors offer global and per-team / per-use case connections details.
>>>>>>>>
>>>>>>>> In general, I think fitting connections into the existing
>> concepts
>>>> for
>>>>> catalog objects (with three-part identifier) makes managing them
>>> easier.
>>>>> But I also see the need for global defaults.
>>>>>>>>
>>>>>>>> Btw keep in mind that a catalog implementation should only store
>>>>> metadata. Similar how a CatalogTable doesn't store the actual data, a
>>>>> CatalogConnection should not store the credentials. It should only
>>> offer
>>>> a
>>>>> factory that allows for storing and retrieving them. In real world
>>>>> scenarios a factory is most likely backed by a product like Azure Key
>>>> Vault.
>>>>>>>>
>>>>>>>> So code-wise having a ConnectionManager that behaves similar to
>>>>> FunctionManager sounds reasonable.
>>>>>>>>
>>>>>>>> +1 for having special syntax instead of using properties. This
>>> allows
>>>>> to access connections in tables, models, functions. And catalogs, if
>> we
>>>>> agree to have global ones as well.
>>>>>>>>
>>>>>>>> What do you think?
>>>>>>>>
>>>>>>>> Let me spend some more thoughts on this and come back with a
>>> concrete
>>>>> proposal by early next week.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Timo
>>>>>>>>
>>>>>>>> [1]
>> https://docs.snowflake.com/en/sql-reference/sql/create-secret
>>>>>>>> [2]
>>>>>
>> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>>>>>>>>
>>>>>>>> On 04.06.25 10:47, Leonard Xu wrote:
>>>>>>>>> Hey,Mayank
>>>>>>>>> Please see my feedback as following:
>>>>>>>>> 1. One of the motivations of this FLIP is to improve security.
>>>>> However, the current design stores all connection information in the
>>>>> catalog,
>>>>>>>>> and each Flink SQL job reads from the catalog during
>> compilation.
>>>> The
>>>>> connection information is passed between SQL Gateway and the
>>>>>>>>> catalog in plaintext, which actually introduces new security
>>> risks.
>>>>>>>>> 2. The name "Connection" should be changed to something like
>>>>> ConnectionSpec to clearly indicate that it is a object containing
>> only
>>>>> static
>>>>>>>>> properties without a lifecycle. Putting aside the naming issue,
>> I
>>>>> think the current model and hierarchy design is somewhat strange.
>>> Storing
>>>>>>>>> various kinds of connections (e.g., Kafka, MySQL) in the same
>>>> Catalog
>>>>> with hierarchical identifiers like
>> catalog-name.db-name.connection-name
>>>>>>>>> raises the following questions:
>>>>>>>>> (1) What is the purpose of this hierarchical structure of
>>> Connection
>>>>> object ?
>>>>>>>>> (2) If we can use a Connection to create a MySQL table, why
>> can't
>>> we
>>>>> use a Connection to create a MySQL Catalog?
>>>>>>>>> 3. Regarding the connector usage examples given in this FLIP:
>>>>>>>>> ```sql
>>>>>>>>> 1  -- Example 2: Using connection for jdbc tables
>>>>>>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>>>>>>>>> 3  WITH (
>>>>>>>>> 4    'type' = 'jdbc',
>>>>>>>>> 5    'jdbc.url' = 'jdbc:mysql://
>>>>> customer-db.example.com:3306/customerdb',
>>>>>>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>>>>>>>>> 7  );
>>>>>>>>> 8
>>>>>>>>> 9  CREATE TABLE customers (
>>>>>>>>> 10   customer_id INT,
>>>>>>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>>>>>>>>> 12 ) WITH (
>>>>>>>>> 13   'connector' = 'jdbc',
>>>>>>>>> 14   'jdbc.connection' = 'mysql_customer_db',
>>>>>>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>>>>>>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>>>>>>>>> 17   'jdbc.table-name' = 'customers',
>>>>>>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>>>>>>>>> 19 );
>>>>>>>>> ```
>>>>>>>>> I see three issues from SQL semantics and Connector
>> compatibility
>>>>> perspectives:
>>>>>>>>> (1) Look at line 14: `mysql_customer_db` is an object identifier
>>> of
>>>> a
>>>>> CONNECTION defined in SQL. However, this identifier is referenced
>>>>>>>>>      via a string value inside the table’s WITH clause, which
>> feel
>>>>> hack for me.
>>>>>>>>> (2) Look at lines 14–16: the use of the specific prefix
>>>>> `jdbc.connection` will confuse users because `connection.xx` maybe
>>>> already
>>>>> used as
>>>>>>>>>   a prefix for existing configuration items.
>>>>>>>>> (3) Look at lines 14–18: Why do all existing configuration
>> options
>>>>> need to be prefixed with `jdbc`, even they’re not related to
>> Connection
>>>>> properties?
>>>>>>>>> This completely changes user habits — is it backward compatible?
>>>>>>>>>   In my opinion, Connection should be a model independent of both
>>>>> Catalog and Table, and can be referenced by all
>> catalog/table/udf/model
>>>>> object.
>>>>>>>>> It should be managed by a Component such as a ConnectionManager
>> to
>>>>> enable reuse. For security purposes, authentication mechanisms could
>>>>>>>>> be supported within the ConnectionManager.
>>>>>>>>> Best,
>>>>>>>>> Leonard
>>>>>>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
>>>>>>>>>>
>>>>>>>>>> Hi all,
>>>>>>>>>>
>>>>>>>>>> First of all, I think having a Connection resource is something
>>>> that
>>>>> will
>>>>>>>>>> be beneficial for Apache Flink. I could see that being extended
>>> in
>>>>> the
>>>>>>>>>> future to allow for easier secret handling [1].
>>>>>>>>>> In my mental mind, I'm comparing this proposal against SQL/MED
>>> from
>>>>> the ISO
>>>>>>>>>> standard [2]. I do think that SQL/MED isn't a very user
>> friendly
>>>>> syntax
>>>>>>>>>> though, looking at Postgres for example [3].
>>>>>>>>>>
>>>>>>>>>> I think it's a valid question if Connection should be
>> considered
>>>>> with a
>>>>>>>>>> catalog or database-level scope. @Ryan can you share something
>>>> more,
>>>>> since
>>>>>>>>>> you've mentioned "Note: I much prefer catalogs for this case.
>>> Which
>>>>> is what
>>>>>>>>>> we use internally to manage connection properties". It looks
>> like
>>>>> there
>>>>>>>>>> isn't a strong favourable approach looking at other vendors
>>> (like,
>>>>>>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
>>>> database
>>>>>>>>>> level).
>>>>>>>>>>
>>>>>>>>>> Also looking forward to Leonard's input.
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>>
>>>>>>>>>> Martijn
>>>>>>>>>>
>>>>>>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>>>>>>>>> [2] https://www.iso.org/standard/84804.html
>>>>>>>>>> [3]
>>> https://www.postgresql.org/docs/current/sql-createserver.html
>>>>>>>>>>
>>>>>>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com>
>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hey Mayank.
>>>>>>>>>>>
>>>>>>>>>>> Thanks for the FLIP, I went through this FLIP quickly and
>> found
>>>> some
>>>>>>>>>>> issues which I think we
>>>>>>>>>>> need to deep discuss later. As we’re on a short Dragon boat
>>>>> Festival,
>>>>>>>>>>> could you kindly hold
>>>>>>>>>>> on this thread? and we will back to continue the FLIP discuss.
>>>>>>>>>>>
>>>>>>>>>>> Best,
>>>>>>>>>>> Leonard
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
>> 写道:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>
>>>>>>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
>>>>>>>>>>>>
>>>>>>>>>>>> Motivation:
>>>>>>>>>>>> Currently, Flink SQL handles external connectivity by
>> defining
>>>>> endpoints
>>>>>>>>>>>> and credentials in table configuration. This approach
>> prevents
>>>>>>>>>>> reusability
>>>>>>>>>>>> of these connections and makes table definition less secure
>> by
>>>>> exposing
>>>>>>>>>>>> sensitive information.
>>>>>>>>>>>> We propose the introduction of a new "connection" resource in
>>>>> Flink. This
>>>>>>>>>>>> will be a pluggable resource configured with a remote
>> endpoint
>>>> and
>>>>>>>>>>>> associated access key. Once defined, connections can be
>> reused
>>>>> across
>>>>>>>>>>> table
>>>>>>>>>>>> definitions, and eventually for model definition (as
>> discussed
>>> in
>>>>>>>>>>> FLIP-437)
>>>>>>>>>>>> for inference, enabling seamless and secure integration with
>>>>> external
>>>>>>>>>>>> systems.
>>>>>>>>>>>> The connection resource will provide a new, optional way to
>>>> manage
>>>>>>>>>>> external
>>>>>>>>>>>> connectivity in Flink. Existing methods for table definitions
>>>> will
>>>>> remain
>>>>>>>>>>>> unchanged.
>>>>>>>>>>>>
>>>>>>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>>>>>>>>>
>>>>>>>>>>>> Best Regards,
>>>>>>>>>>>> Mayank Juneja
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> *Mayank Juneja*
>>>> Product Manager | Data Streaming and AI
>>>>
>>>
>>
> 
> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Mayank Juneja <ma...@gmail.com>.
Hi Ryan and Austin,

Thanks for your suggestions. I've updated the FLIP with the following
additional info -

1. *table.secret-store.kind* key to register the SecretStore in a yaml file
2. *updateSecret* method in WritableSecretStore interface

Thanks,
Mayank

On Thu, Jul 17, 2025 at 5:42 PM Austin Cawley-Edwards <
austin.cawley@gmail.com> wrote:

> Hey all,
>
> Thanks for the nice flip all! I’m just reading through – had one question
> on the ALTER CONNECTION implementation flow. Would it make sense for the
> WritableSecretStore to expose a method for updating a secret by ID, so it
> can be done atomically? Else, would we need to call delete and create
> again, potentially introducing concurrent resolution errors?
>
> Best,
> Austin
>
> On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
> <ry...@shopify.com.invalid> wrote:
>
> > Hi Mayank,
> >
> > Thanks for updating the FLIP. Overall it looks good to me.
> >
> > One question I had related to how someone could choose the SecretStore
> they
> > want to use if they use something like the SQL Gateway as the entrypoint
> on
> > top of a remote Session cluster. I don't see an explicit way to set the
> > SecretStore in the FLIP.
> > I assume we'll do it similar to the CatalogStore but I wanted to call
> this
> > out.
> >
> > table.catalog-store.kind: filetable.catalog-store.file.path:
> > file:///path/to/catalog/store/
> >
> > Ryan van Huuksloot
> > Staff Engineer, Infrastructure | Streaming Platform
> > [image: Shopify]
> > <https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email
> >
> >
> >
> > On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <ma...@gmail.com>
> > wrote:
> >
> > > Hi everyone,
> > >
> > > Thanks for your valuable inputs. I have updated the FLIP with the ideas
> > > proposed earlier in the thread. Looking forward to your feedback.
> > > https://cwiki.apache.org/confluence/x/cYroF
> > >
> > > Best,
> > > Mayank
> > >
> > > On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com> wrote:
> > >
> > > > Quick response, thanks Mayank, Hao and Timo for the effort.  The new
> > > > proposal looks well, +1 from my side.
> > > >
> > > > Could you draft(update) current FLIP docs thus we can have some
> > specific
> > > > discussions later?
> > > >
> > > >
> > > > Best,
> > > > Leonard
> > > >
> > > >
> > > > > 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> > > > >
> > > > > Hi everyone,
> > > > >
> > > > > sorry for the late reply, feature freeze kept me busy. Mayank, Hao
> > and
> > > I
> > > > synced offline and came up we an improved proposal. Before we update
> > the
> > > > FLIP let me summarize the most important key facts that hopefully
> > address
> > > > most concerns:
> > > > >
> > > > > 1) SecretStore
> > > > > - Similar to CatalogStore, we introduce a SecretStore as the
> highest
> > > > level in TableEnvironment.
> > > > > - SecretStore is initialized with options and potentially
> environment
> > > > variables. Including
> EnvironmentSettings.withSecretStore(SecretStore).
> > > > > - The SecretStore is pluggable and discovered using the regular
> > > > factory-approach.
> > > > > - For example, it could implement Azure Key Vault or other cloud
> > > > provider secrets stores.
> > > > > - Goal: Flink and Flink catalogs do not have to deal with sensitive
> > > data.
> > > > >
> > > > > 2) Connections
> > > > > - Connections are catalog objects identified with 3-part
> identifiers.
> > > > 3-part identifiers are crucial for managability of larger projects
> and
> > > > align with existing catalog objects.
> > > > > - They contain connection details, e.g. URL, query parameters, and
> > > other
> > > > configuration.
> > > > > - They do not contain secrets, but only pointers to secrets in the
> > > > SecretStore.
> > > > >
> > > > > 3) Connection DDL
> > > > >
> > > > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > > >  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> > > > >  ...
> > > > > )
> > > > >
> > > > > - Connection type is pluggable and discovered using the regular
> > > > factory-approach.
> > > > > - The factory extracts secrets and puts them into SecretStore.
> > > > > - The factory only leaves non-confidential options left that can be
> > > > stored in a catalog.
> > > > >
> > > > > When executing:
> > > > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > > >  'type' = 'basic',
> > > > >  'url' = 'api.example.com',
> > > > >  'username' = 'bob',
> > > > >  'password' = 'xyz'
> > > > > )
> > > > >
> > > > > The catalog will receive something similar to:
> > > > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > > >  'type' = 'basic',
> > > > >  'url' = 'api.example.com',
> > > > >  'secret.store' = 'azure-key-vault'
> > > > >  'secret.id' = 'secretId'
> > > > > )
> > > > >
> > > > > - However, the exact property design is up to the connection
> factory.
> > > > >
> > > > > 4) Connection Usage
> > > > >
> > > > > CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> > > > >
> > > > > - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
> > > > similar to BigQuery.
> > > > > - The connection will be provided in a table/model
> provider/function
> > > > definition factory.
> > > > >
> > > > > 5) CatalogStore / Catalog Initialization
> > > > >
> > > > > Catalog store or catalog can make use of SecretStore to retrieve
> > > initial
> > > > credentials for bootstrapping. All objects lower then catalog
> > > store/catalog
> > > > can then use connections. If you think we still need system level
> > > > connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH
> > (..)
> > > > similar to SYSTEM functions directly store in a ConnectioManager in
> > > > TableEnvironment. But for now I would suggest to start simple with
> > > > per-catalog connections and later evolve the design.
> > > > >
> > > > > Dealing with secrets is a very sensitive topic and I'm clearly not
> an
> > > > expert on it. This is why we should try to push the problem to
> existing
> > > > solutions and don't start storing secrets in Flink in any way. Thus,
> > the
> > > > interfaces will be defined very generic.
> > > > >
> > > > > Looking forward to your feedback.
> > > > >
> > > > > Cheers,
> > > > > Timo
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 09.06.25 04:01, Leonard Xu wrote:
> > > > >> Thanks  Timo for joining this thread.
> > > > >> I agree that this feature is needed by the community; the current
> > > > disagreement is only about the implementation method or solution.
> > > > >> Your thoughts looks generally good to me, looking forward to your
> > > > proposal.
> > > > >> Best,
> > > > >> Leonard
> > > > >>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> > > > >>>
> > > > >>> Hi everyone,
> > > > >>>
> > > > >>> thanks for this healthy discussion. Looking at high number of
> > > > participants, it looks like we definitely want this feature. We just
> > need
> > > > to figure out the "how".
> > > > >>>
> > > > >>> This reminds me very much of the discussion we had for CREATE
> > > > FUNCTION. There, we discussed whether functions should be named
> > globally
> > > or
> > > > catalog-specific. In the end, we decided for both `CREATE SYSTEM
> > > FUNCTION`
> > > > and `CREATE FUNCTION`, satisfying both the data platform team of an
> > > > organization (which might provide system functions) and individual
> data
> > > > teams or use cases (scoped by catalog/database).
> > > > >>>
> > > > >>> Looking at other modern vendors like Snowflake there is SECRET
> > > (scoped
> > > > to schema) [1] and API INTEGRATION [2] (scoped to account). So also
> > other
> > > > vendors offer global and per-team / per-use case connections details.
> > > > >>>
> > > > >>> In general, I think fitting connections into the existing
> concepts
> > > for
> > > > catalog objects (with three-part identifier) makes managing them
> > easier.
> > > > But I also see the need for global defaults.
> > > > >>>
> > > > >>> Btw keep in mind that a catalog implementation should only store
> > > > metadata. Similar how a CatalogTable doesn't store the actual data, a
> > > > CatalogConnection should not store the credentials. It should only
> > offer
> > > a
> > > > factory that allows for storing and retrieving them. In real world
> > > > scenarios a factory is most likely backed by a product like Azure Key
> > > Vault.
> > > > >>>
> > > > >>> So code-wise having a ConnectionManager that behaves similar to
> > > > FunctionManager sounds reasonable.
> > > > >>>
> > > > >>> +1 for having special syntax instead of using properties. This
> > allows
> > > > to access connections in tables, models, functions. And catalogs, if
> we
> > > > agree to have global ones as well.
> > > > >>>
> > > > >>> What do you think?
> > > > >>>
> > > > >>> Let me spend some more thoughts on this and come back with a
> > concrete
> > > > proposal by early next week.
> > > > >>>
> > > > >>> Cheers,
> > > > >>> Timo
> > > > >>>
> > > > >>> [1]
> https://docs.snowflake.com/en/sql-reference/sql/create-secret
> > > > >>> [2]
> > > >
> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> > > > >>>
> > > > >>> On 04.06.25 10:47, Leonard Xu wrote:
> > > > >>>> Hey,Mayank
> > > > >>>> Please see my feedback as following:
> > > > >>>> 1. One of the motivations of this FLIP is to improve security.
> > > > However, the current design stores all connection information in the
> > > > catalog,
> > > > >>>> and each Flink SQL job reads from the catalog during
> compilation.
> > > The
> > > > connection information is passed between SQL Gateway and the
> > > > >>>> catalog in plaintext, which actually introduces new security
> > risks.
> > > > >>>> 2. The name "Connection" should be changed to something like
> > > > ConnectionSpec to clearly indicate that it is a object containing
> only
> > > > static
> > > > >>>> properties without a lifecycle. Putting aside the naming issue,
> I
> > > > think the current model and hierarchy design is somewhat strange.
> > Storing
> > > > >>>> various kinds of connections (e.g., Kafka, MySQL) in the same
> > > Catalog
> > > > with hierarchical identifiers like
> catalog-name.db-name.connection-name
> > > > >>>> raises the following questions:
> > > > >>>> (1) What is the purpose of this hierarchical structure of
> > Connection
> > > > object ?
> > > > >>>> (2) If we can use a Connection to create a MySQL table, why
> can't
> > we
> > > > use a Connection to create a MySQL Catalog?
> > > > >>>> 3. Regarding the connector usage examples given in this FLIP:
> > > > >>>> ```sql
> > > > >>>> 1  -- Example 2: Using connection for jdbc tables
> > > > >>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> > > > >>>> 3  WITH (
> > > > >>>> 4    'type' = 'jdbc',
> > > > >>>> 5    'jdbc.url' = 'jdbc:mysql://
> > > > customer-db.example.com:3306/customerdb',
> > > > >>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> > > > >>>> 7  );
> > > > >>>> 8
> > > > >>>> 9  CREATE TABLE customers (
> > > > >>>> 10   customer_id INT,
> > > > >>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> > > > >>>> 12 ) WITH (
> > > > >>>> 13   'connector' = 'jdbc',
> > > > >>>> 14   'jdbc.connection' = 'mysql_customer_db',
> > > > >>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> > > > >>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> > > > >>>> 17   'jdbc.table-name' = 'customers',
> > > > >>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> > > > >>>> 19 );
> > > > >>>> ```
> > > > >>>> I see three issues from SQL semantics and Connector
> compatibility
> > > > perspectives:
> > > > >>>> (1) Look at line 14: `mysql_customer_db` is an object identifier
> > of
> > > a
> > > > CONNECTION defined in SQL. However, this identifier is referenced
> > > > >>>>     via a string value inside the table’s WITH clause, which
> feel
> > > > hack for me.
> > > > >>>> (2) Look at lines 14–16: the use of the specific prefix
> > > > `jdbc.connection` will confuse users because `connection.xx` maybe
> > > already
> > > > used as
> > > > >>>>  a prefix for existing configuration items.
> > > > >>>> (3) Look at lines 14–18: Why do all existing configuration
> options
> > > > need to be prefixed with `jdbc`, even they’re not related to
> Connection
> > > > properties?
> > > > >>>> This completely changes user habits — is it backward compatible?
> > > > >>>>  In my opinion, Connection should be a model independent of both
> > > > Catalog and Table, and can be referenced by all
> catalog/table/udf/model
> > > > object.
> > > > >>>> It should be managed by a Component such as a ConnectionManager
> to
> > > > enable reuse. For security purposes, authentication mechanisms could
> > > > >>>> be supported within the ConnectionManager.
> > > > >>>> Best,
> > > > >>>> Leonard
> > > > >>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> > > > >>>>>
> > > > >>>>> Hi all,
> > > > >>>>>
> > > > >>>>> First of all, I think having a Connection resource is something
> > > that
> > > > will
> > > > >>>>> be beneficial for Apache Flink. I could see that being extended
> > in
> > > > the
> > > > >>>>> future to allow for easier secret handling [1].
> > > > >>>>> In my mental mind, I'm comparing this proposal against SQL/MED
> > from
> > > > the ISO
> > > > >>>>> standard [2]. I do think that SQL/MED isn't a very user
> friendly
> > > > syntax
> > > > >>>>> though, looking at Postgres for example [3].
> > > > >>>>>
> > > > >>>>> I think it's a valid question if Connection should be
> considered
> > > > with a
> > > > >>>>> catalog or database-level scope. @Ryan can you share something
> > > more,
> > > > since
> > > > >>>>> you've mentioned "Note: I much prefer catalogs for this case.
> > Which
> > > > is what
> > > > >>>>> we use internally to manage connection properties". It looks
> like
> > > > there
> > > > >>>>> isn't a strong favourable approach looking at other vendors
> > (like,
> > > > >>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
> > > database
> > > > >>>>> level).
> > > > >>>>>
> > > > >>>>> Also looking forward to Leonard's input.
> > > > >>>>>
> > > > >>>>> Best regards,
> > > > >>>>>
> > > > >>>>> Martijn
> > > > >>>>>
> > > > >>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> > > > >>>>> [2] https://www.iso.org/standard/84804.html
> > > > >>>>> [3]
> > https://www.postgresql.org/docs/current/sql-createserver.html
> > > > >>>>>
> > > > >>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com>
> > > > wrote:
> > > > >>>>>
> > > > >>>>>> Hey Mayank.
> > > > >>>>>>
> > > > >>>>>> Thanks for the FLIP, I went through this FLIP quickly and
> found
> > > some
> > > > >>>>>> issues which I think we
> > > > >>>>>> need to deep discuss later. As we’re on a short Dragon boat
> > > > Festival,
> > > > >>>>>> could you kindly hold
> > > > >>>>>> on this thread? and we will back to continue the FLIP discuss.
> > > > >>>>>>
> > > > >>>>>> Best,
> > > > >>>>>> Leonard
> > > > >>>>>>
> > > > >>>>>>
> > > > >>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com>
> 写道:
> > > > >>>>>>>
> > > > >>>>>>> Hi all,
> > > > >>>>>>>
> > > > >>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> > > > >>>>>>>
> > > > >>>>>>> Motivation:
> > > > >>>>>>> Currently, Flink SQL handles external connectivity by
> defining
> > > > endpoints
> > > > >>>>>>> and credentials in table configuration. This approach
> prevents
> > > > >>>>>> reusability
> > > > >>>>>>> of these connections and makes table definition less secure
> by
> > > > exposing
> > > > >>>>>>> sensitive information.
> > > > >>>>>>> We propose the introduction of a new "connection" resource in
> > > > Flink. This
> > > > >>>>>>> will be a pluggable resource configured with a remote
> endpoint
> > > and
> > > > >>>>>>> associated access key. Once defined, connections can be
> reused
> > > > across
> > > > >>>>>> table
> > > > >>>>>>> definitions, and eventually for model definition (as
> discussed
> > in
> > > > >>>>>> FLIP-437)
> > > > >>>>>>> for inference, enabling seamless and secure integration with
> > > > external
> > > > >>>>>>> systems.
> > > > >>>>>>> The connection resource will provide a new, optional way to
> > > manage
> > > > >>>>>> external
> > > > >>>>>>> connectivity in Flink. Existing methods for table definitions
> > > will
> > > > remain
> > > > >>>>>>> unchanged.
> > > > >>>>>>>
> > > > >>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> > > > >>>>>>>
> > > > >>>>>>> Best Regards,
> > > > >>>>>>> Mayank Juneja
> > > > >>>>>>
> > > > >>>>>>
> > > > >>>
> > > > >
> > > >
> > > >
> > >
> > > --
> > > *Mayank Juneja*
> > > Product Manager | Data Streaming and AI
> > >
> >
>


-- 
*Mayank Juneja*
Product Manager | Data Streaming and AI

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Austin Cawley-Edwards <au...@gmail.com>.
Hey all,

Thanks for the nice flip all! I’m just reading through – had one question
on the ALTER CONNECTION implementation flow. Would it make sense for the
WritableSecretStore to expose a method for updating a secret by ID, so it
can be done atomically? Else, would we need to call delete and create
again, potentially introducing concurrent resolution errors?

Best,
Austin

On Thu, Jul 17, 2025 at 13:07 Ryan van Huuksloot
<ry...@shopify.com.invalid> wrote:

> Hi Mayank,
>
> Thanks for updating the FLIP. Overall it looks good to me.
>
> One question I had related to how someone could choose the SecretStore they
> want to use if they use something like the SQL Gateway as the entrypoint on
> top of a remote Session cluster. I don't see an explicit way to set the
> SecretStore in the FLIP.
> I assume we'll do it similar to the CatalogStore but I wanted to call this
> out.
>
> table.catalog-store.kind: filetable.catalog-store.file.path:
> file:///path/to/catalog/store/
>
> Ryan van Huuksloot
> Staff Engineer, Infrastructure | Streaming Platform
> [image: Shopify]
> <https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>
>
>
> On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <ma...@gmail.com>
> wrote:
>
> > Hi everyone,
> >
> > Thanks for your valuable inputs. I have updated the FLIP with the ideas
> > proposed earlier in the thread. Looking forward to your feedback.
> > https://cwiki.apache.org/confluence/x/cYroF
> >
> > Best,
> > Mayank
> >
> > On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com> wrote:
> >
> > > Quick response, thanks Mayank, Hao and Timo for the effort.  The new
> > > proposal looks well, +1 from my side.
> > >
> > > Could you draft(update) current FLIP docs thus we can have some
> specific
> > > discussions later?
> > >
> > >
> > > Best,
> > > Leonard
> > >
> > >
> > > > 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> > > >
> > > > Hi everyone,
> > > >
> > > > sorry for the late reply, feature freeze kept me busy. Mayank, Hao
> and
> > I
> > > synced offline and came up we an improved proposal. Before we update
> the
> > > FLIP let me summarize the most important key facts that hopefully
> address
> > > most concerns:
> > > >
> > > > 1) SecretStore
> > > > - Similar to CatalogStore, we introduce a SecretStore as the highest
> > > level in TableEnvironment.
> > > > - SecretStore is initialized with options and potentially environment
> > > variables. Including EnvironmentSettings.withSecretStore(SecretStore).
> > > > - The SecretStore is pluggable and discovered using the regular
> > > factory-approach.
> > > > - For example, it could implement Azure Key Vault or other cloud
> > > provider secrets stores.
> > > > - Goal: Flink and Flink catalogs do not have to deal with sensitive
> > data.
> > > >
> > > > 2) Connections
> > > > - Connections are catalog objects identified with 3-part identifiers.
> > > 3-part identifiers are crucial for managability of larger projects and
> > > align with existing catalog objects.
> > > > - They contain connection details, e.g. URL, query parameters, and
> > other
> > > configuration.
> > > > - They do not contain secrets, but only pointers to secrets in the
> > > SecretStore.
> > > >
> > > > 3) Connection DDL
> > > >
> > > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > >  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> > > >  ...
> > > > )
> > > >
> > > > - Connection type is pluggable and discovered using the regular
> > > factory-approach.
> > > > - The factory extracts secrets and puts them into SecretStore.
> > > > - The factory only leaves non-confidential options left that can be
> > > stored in a catalog.
> > > >
> > > > When executing:
> > > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > >  'type' = 'basic',
> > > >  'url' = 'api.example.com',
> > > >  'username' = 'bob',
> > > >  'password' = 'xyz'
> > > > )
> > > >
> > > > The catalog will receive something similar to:
> > > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > > >  'type' = 'basic',
> > > >  'url' = 'api.example.com',
> > > >  'secret.store' = 'azure-key-vault'
> > > >  'secret.id' = 'secretId'
> > > > )
> > > >
> > > > - However, the exact property design is up to the connection factory.
> > > >
> > > > 4) Connection Usage
> > > >
> > > > CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> > > >
> > > > - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
> > > similar to BigQuery.
> > > > - The connection will be provided in a table/model provider/function
> > > definition factory.
> > > >
> > > > 5) CatalogStore / Catalog Initialization
> > > >
> > > > Catalog store or catalog can make use of SecretStore to retrieve
> > initial
> > > credentials for bootstrapping. All objects lower then catalog
> > store/catalog
> > > can then use connections. If you think we still need system level
> > > connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH
> (..)
> > > similar to SYSTEM functions directly store in a ConnectioManager in
> > > TableEnvironment. But for now I would suggest to start simple with
> > > per-catalog connections and later evolve the design.
> > > >
> > > > Dealing with secrets is a very sensitive topic and I'm clearly not an
> > > expert on it. This is why we should try to push the problem to existing
> > > solutions and don't start storing secrets in Flink in any way. Thus,
> the
> > > interfaces will be defined very generic.
> > > >
> > > > Looking forward to your feedback.
> > > >
> > > > Cheers,
> > > > Timo
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On 09.06.25 04:01, Leonard Xu wrote:
> > > >> Thanks  Timo for joining this thread.
> > > >> I agree that this feature is needed by the community; the current
> > > disagreement is only about the implementation method or solution.
> > > >> Your thoughts looks generally good to me, looking forward to your
> > > proposal.
> > > >> Best,
> > > >> Leonard
> > > >>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> > > >>>
> > > >>> Hi everyone,
> > > >>>
> > > >>> thanks for this healthy discussion. Looking at high number of
> > > participants, it looks like we definitely want this feature. We just
> need
> > > to figure out the "how".
> > > >>>
> > > >>> This reminds me very much of the discussion we had for CREATE
> > > FUNCTION. There, we discussed whether functions should be named
> globally
> > or
> > > catalog-specific. In the end, we decided for both `CREATE SYSTEM
> > FUNCTION`
> > > and `CREATE FUNCTION`, satisfying both the data platform team of an
> > > organization (which might provide system functions) and individual data
> > > teams or use cases (scoped by catalog/database).
> > > >>>
> > > >>> Looking at other modern vendors like Snowflake there is SECRET
> > (scoped
> > > to schema) [1] and API INTEGRATION [2] (scoped to account). So also
> other
> > > vendors offer global and per-team / per-use case connections details.
> > > >>>
> > > >>> In general, I think fitting connections into the existing concepts
> > for
> > > catalog objects (with three-part identifier) makes managing them
> easier.
> > > But I also see the need for global defaults.
> > > >>>
> > > >>> Btw keep in mind that a catalog implementation should only store
> > > metadata. Similar how a CatalogTable doesn't store the actual data, a
> > > CatalogConnection should not store the credentials. It should only
> offer
> > a
> > > factory that allows for storing and retrieving them. In real world
> > > scenarios a factory is most likely backed by a product like Azure Key
> > Vault.
> > > >>>
> > > >>> So code-wise having a ConnectionManager that behaves similar to
> > > FunctionManager sounds reasonable.
> > > >>>
> > > >>> +1 for having special syntax instead of using properties. This
> allows
> > > to access connections in tables, models, functions. And catalogs, if we
> > > agree to have global ones as well.
> > > >>>
> > > >>> What do you think?
> > > >>>
> > > >>> Let me spend some more thoughts on this and come back with a
> concrete
> > > proposal by early next week.
> > > >>>
> > > >>> Cheers,
> > > >>> Timo
> > > >>>
> > > >>> [1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
> > > >>> [2]
> > > https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> > > >>>
> > > >>> On 04.06.25 10:47, Leonard Xu wrote:
> > > >>>> Hey,Mayank
> > > >>>> Please see my feedback as following:
> > > >>>> 1. One of the motivations of this FLIP is to improve security.
> > > However, the current design stores all connection information in the
> > > catalog,
> > > >>>> and each Flink SQL job reads from the catalog during compilation.
> > The
> > > connection information is passed between SQL Gateway and the
> > > >>>> catalog in plaintext, which actually introduces new security
> risks.
> > > >>>> 2. The name "Connection" should be changed to something like
> > > ConnectionSpec to clearly indicate that it is a object containing only
> > > static
> > > >>>> properties without a lifecycle. Putting aside the naming issue, I
> > > think the current model and hierarchy design is somewhat strange.
> Storing
> > > >>>> various kinds of connections (e.g., Kafka, MySQL) in the same
> > Catalog
> > > with hierarchical identifiers like catalog-name.db-name.connection-name
> > > >>>> raises the following questions:
> > > >>>> (1) What is the purpose of this hierarchical structure of
> Connection
> > > object ?
> > > >>>> (2) If we can use a Connection to create a MySQL table, why can't
> we
> > > use a Connection to create a MySQL Catalog?
> > > >>>> 3. Regarding the connector usage examples given in this FLIP:
> > > >>>> ```sql
> > > >>>> 1  -- Example 2: Using connection for jdbc tables
> > > >>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> > > >>>> 3  WITH (
> > > >>>> 4    'type' = 'jdbc',
> > > >>>> 5    'jdbc.url' = 'jdbc:mysql://
> > > customer-db.example.com:3306/customerdb',
> > > >>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> > > >>>> 7  );
> > > >>>> 8
> > > >>>> 9  CREATE TABLE customers (
> > > >>>> 10   customer_id INT,
> > > >>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> > > >>>> 12 ) WITH (
> > > >>>> 13   'connector' = 'jdbc',
> > > >>>> 14   'jdbc.connection' = 'mysql_customer_db',
> > > >>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> > > >>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> > > >>>> 17   'jdbc.table-name' = 'customers',
> > > >>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> > > >>>> 19 );
> > > >>>> ```
> > > >>>> I see three issues from SQL semantics and Connector compatibility
> > > perspectives:
> > > >>>> (1) Look at line 14: `mysql_customer_db` is an object identifier
> of
> > a
> > > CONNECTION defined in SQL. However, this identifier is referenced
> > > >>>>     via a string value inside the table’s WITH clause, which feel
> > > hack for me.
> > > >>>> (2) Look at lines 14–16: the use of the specific prefix
> > > `jdbc.connection` will confuse users because `connection.xx` maybe
> > already
> > > used as
> > > >>>>  a prefix for existing configuration items.
> > > >>>> (3) Look at lines 14–18: Why do all existing configuration options
> > > need to be prefixed with `jdbc`, even they’re not related to Connection
> > > properties?
> > > >>>> This completely changes user habits — is it backward compatible?
> > > >>>>  In my opinion, Connection should be a model independent of both
> > > Catalog and Table, and can be referenced by all catalog/table/udf/model
> > > object.
> > > >>>> It should be managed by a Component such as a ConnectionManager to
> > > enable reuse. For security purposes, authentication mechanisms could
> > > >>>> be supported within the ConnectionManager.
> > > >>>> Best,
> > > >>>> Leonard
> > > >>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> > > >>>>>
> > > >>>>> Hi all,
> > > >>>>>
> > > >>>>> First of all, I think having a Connection resource is something
> > that
> > > will
> > > >>>>> be beneficial for Apache Flink. I could see that being extended
> in
> > > the
> > > >>>>> future to allow for easier secret handling [1].
> > > >>>>> In my mental mind, I'm comparing this proposal against SQL/MED
> from
> > > the ISO
> > > >>>>> standard [2]. I do think that SQL/MED isn't a very user friendly
> > > syntax
> > > >>>>> though, looking at Postgres for example [3].
> > > >>>>>
> > > >>>>> I think it's a valid question if Connection should be considered
> > > with a
> > > >>>>> catalog or database-level scope. @Ryan can you share something
> > more,
> > > since
> > > >>>>> you've mentioned "Note: I much prefer catalogs for this case.
> Which
> > > is what
> > > >>>>> we use internally to manage connection properties". It looks like
> > > there
> > > >>>>> isn't a strong favourable approach looking at other vendors
> (like,
> > > >>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
> > database
> > > >>>>> level).
> > > >>>>>
> > > >>>>> Also looking forward to Leonard's input.
> > > >>>>>
> > > >>>>> Best regards,
> > > >>>>>
> > > >>>>> Martijn
> > > >>>>>
> > > >>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> > > >>>>> [2] https://www.iso.org/standard/84804.html
> > > >>>>> [3]
> https://www.postgresql.org/docs/current/sql-createserver.html
> > > >>>>>
> > > >>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com>
> > > wrote:
> > > >>>>>
> > > >>>>>> Hey Mayank.
> > > >>>>>>
> > > >>>>>> Thanks for the FLIP, I went through this FLIP quickly and found
> > some
> > > >>>>>> issues which I think we
> > > >>>>>> need to deep discuss later. As we’re on a short Dragon boat
> > > Festival,
> > > >>>>>> could you kindly hold
> > > >>>>>> on this thread? and we will back to continue the FLIP discuss.
> > > >>>>>>
> > > >>>>>> Best,
> > > >>>>>> Leonard
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> > > >>>>>>>
> > > >>>>>>> Hi all,
> > > >>>>>>>
> > > >>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> > > >>>>>>>
> > > >>>>>>> Motivation:
> > > >>>>>>> Currently, Flink SQL handles external connectivity by defining
> > > endpoints
> > > >>>>>>> and credentials in table configuration. This approach prevents
> > > >>>>>> reusability
> > > >>>>>>> of these connections and makes table definition less secure by
> > > exposing
> > > >>>>>>> sensitive information.
> > > >>>>>>> We propose the introduction of a new "connection" resource in
> > > Flink. This
> > > >>>>>>> will be a pluggable resource configured with a remote endpoint
> > and
> > > >>>>>>> associated access key. Once defined, connections can be reused
> > > across
> > > >>>>>> table
> > > >>>>>>> definitions, and eventually for model definition (as discussed
> in
> > > >>>>>> FLIP-437)
> > > >>>>>>> for inference, enabling seamless and secure integration with
> > > external
> > > >>>>>>> systems.
> > > >>>>>>> The connection resource will provide a new, optional way to
> > manage
> > > >>>>>> external
> > > >>>>>>> connectivity in Flink. Existing methods for table definitions
> > will
> > > remain
> > > >>>>>>> unchanged.
> > > >>>>>>>
> > > >>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> > > >>>>>>>
> > > >>>>>>> Best Regards,
> > > >>>>>>> Mayank Juneja
> > > >>>>>>
> > > >>>>>>
> > > >>>
> > > >
> > >
> > >
> >
> > --
> > *Mayank Juneja*
> > Product Manager | Data Streaming and AI
> >
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Ryan van Huuksloot <ry...@shopify.com.INVALID>.
Hi Mayank,

Thanks for updating the FLIP. Overall it looks good to me.

One question I had related to how someone could choose the SecretStore they
want to use if they use something like the SQL Gateway as the entrypoint on
top of a remote Session cluster. I don't see an explicit way to set the
SecretStore in the FLIP.
I assume we'll do it similar to the CatalogStore but I wanted to call this
out.

table.catalog-store.kind: filetable.catalog-store.file.path:
file:///path/to/catalog/store/

Ryan van Huuksloot
Staff Engineer, Infrastructure | Streaming Platform
[image: Shopify]
<https://www.shopify.com/?utm_medium=salessignatures&utm_source=hs_email>


On Wed, Jul 16, 2025 at 2:22 PM Mayank Juneja <ma...@gmail.com>
wrote:

> Hi everyone,
>
> Thanks for your valuable inputs. I have updated the FLIP with the ideas
> proposed earlier in the thread. Looking forward to your feedback.
> https://cwiki.apache.org/confluence/x/cYroF
>
> Best,
> Mayank
>
> On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com> wrote:
>
> > Quick response, thanks Mayank, Hao and Timo for the effort.  The new
> > proposal looks well, +1 from my side.
> >
> > Could you draft(update) current FLIP docs thus we can have some specific
> > discussions later?
> >
> >
> > Best,
> > Leonard
> >
> >
> > > 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> > >
> > > Hi everyone,
> > >
> > > sorry for the late reply, feature freeze kept me busy. Mayank, Hao and
> I
> > synced offline and came up we an improved proposal. Before we update the
> > FLIP let me summarize the most important key facts that hopefully address
> > most concerns:
> > >
> > > 1) SecretStore
> > > - Similar to CatalogStore, we introduce a SecretStore as the highest
> > level in TableEnvironment.
> > > - SecretStore is initialized with options and potentially environment
> > variables. Including EnvironmentSettings.withSecretStore(SecretStore).
> > > - The SecretStore is pluggable and discovered using the regular
> > factory-approach.
> > > - For example, it could implement Azure Key Vault or other cloud
> > provider secrets stores.
> > > - Goal: Flink and Flink catalogs do not have to deal with sensitive
> data.
> > >
> > > 2) Connections
> > > - Connections are catalog objects identified with 3-part identifiers.
> > 3-part identifiers are crucial for managability of larger projects and
> > align with existing catalog objects.
> > > - They contain connection details, e.g. URL, query parameters, and
> other
> > configuration.
> > > - They do not contain secrets, but only pointers to secrets in the
> > SecretStore.
> > >
> > > 3) Connection DDL
> > >
> > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > >  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> > >  ...
> > > )
> > >
> > > - Connection type is pluggable and discovered using the regular
> > factory-approach.
> > > - The factory extracts secrets and puts them into SecretStore.
> > > - The factory only leaves non-confidential options left that can be
> > stored in a catalog.
> > >
> > > When executing:
> > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > >  'type' = 'basic',
> > >  'url' = 'api.example.com',
> > >  'username' = 'bob',
> > >  'password' = 'xyz'
> > > )
> > >
> > > The catalog will receive something similar to:
> > > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> > >  'type' = 'basic',
> > >  'url' = 'api.example.com',
> > >  'secret.store' = 'azure-key-vault'
> > >  'secret.id' = 'secretId'
> > > )
> > >
> > > - However, the exact property design is up to the connection factory.
> > >
> > > 4) Connection Usage
> > >
> > > CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> > >
> > > - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
> > similar to BigQuery.
> > > - The connection will be provided in a table/model provider/function
> > definition factory.
> > >
> > > 5) CatalogStore / Catalog Initialization
> > >
> > > Catalog store or catalog can make use of SecretStore to retrieve
> initial
> > credentials for bootstrapping. All objects lower then catalog
> store/catalog
> > can then use connections. If you think we still need system level
> > connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH (..)
> > similar to SYSTEM functions directly store in a ConnectioManager in
> > TableEnvironment. But for now I would suggest to start simple with
> > per-catalog connections and later evolve the design.
> > >
> > > Dealing with secrets is a very sensitive topic and I'm clearly not an
> > expert on it. This is why we should try to push the problem to existing
> > solutions and don't start storing secrets in Flink in any way. Thus, the
> > interfaces will be defined very generic.
> > >
> > > Looking forward to your feedback.
> > >
> > > Cheers,
> > > Timo
> > >
> > >
> > >
> > >
> > >
> > > On 09.06.25 04:01, Leonard Xu wrote:
> > >> Thanks  Timo for joining this thread.
> > >> I agree that this feature is needed by the community; the current
> > disagreement is only about the implementation method or solution.
> > >> Your thoughts looks generally good to me, looking forward to your
> > proposal.
> > >> Best,
> > >> Leonard
> > >>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> > >>>
> > >>> Hi everyone,
> > >>>
> > >>> thanks for this healthy discussion. Looking at high number of
> > participants, it looks like we definitely want this feature. We just need
> > to figure out the "how".
> > >>>
> > >>> This reminds me very much of the discussion we had for CREATE
> > FUNCTION. There, we discussed whether functions should be named globally
> or
> > catalog-specific. In the end, we decided for both `CREATE SYSTEM
> FUNCTION`
> > and `CREATE FUNCTION`, satisfying both the data platform team of an
> > organization (which might provide system functions) and individual data
> > teams or use cases (scoped by catalog/database).
> > >>>
> > >>> Looking at other modern vendors like Snowflake there is SECRET
> (scoped
> > to schema) [1] and API INTEGRATION [2] (scoped to account). So also other
> > vendors offer global and per-team / per-use case connections details.
> > >>>
> > >>> In general, I think fitting connections into the existing concepts
> for
> > catalog objects (with three-part identifier) makes managing them easier.
> > But I also see the need for global defaults.
> > >>>
> > >>> Btw keep in mind that a catalog implementation should only store
> > metadata. Similar how a CatalogTable doesn't store the actual data, a
> > CatalogConnection should not store the credentials. It should only offer
> a
> > factory that allows for storing and retrieving them. In real world
> > scenarios a factory is most likely backed by a product like Azure Key
> Vault.
> > >>>
> > >>> So code-wise having a ConnectionManager that behaves similar to
> > FunctionManager sounds reasonable.
> > >>>
> > >>> +1 for having special syntax instead of using properties. This allows
> > to access connections in tables, models, functions. And catalogs, if we
> > agree to have global ones as well.
> > >>>
> > >>> What do you think?
> > >>>
> > >>> Let me spend some more thoughts on this and come back with a concrete
> > proposal by early next week.
> > >>>
> > >>> Cheers,
> > >>> Timo
> > >>>
> > >>> [1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
> > >>> [2]
> > https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> > >>>
> > >>> On 04.06.25 10:47, Leonard Xu wrote:
> > >>>> Hey,Mayank
> > >>>> Please see my feedback as following:
> > >>>> 1. One of the motivations of this FLIP is to improve security.
> > However, the current design stores all connection information in the
> > catalog,
> > >>>> and each Flink SQL job reads from the catalog during compilation.
> The
> > connection information is passed between SQL Gateway and the
> > >>>> catalog in plaintext, which actually introduces new security risks.
> > >>>> 2. The name "Connection" should be changed to something like
> > ConnectionSpec to clearly indicate that it is a object containing only
> > static
> > >>>> properties without a lifecycle. Putting aside the naming issue, I
> > think the current model and hierarchy design is somewhat strange. Storing
> > >>>> various kinds of connections (e.g., Kafka, MySQL) in the same
> Catalog
> > with hierarchical identifiers like catalog-name.db-name.connection-name
> > >>>> raises the following questions:
> > >>>> (1) What is the purpose of this hierarchical structure of Connection
> > object ?
> > >>>> (2) If we can use a Connection to create a MySQL table, why can't we
> > use a Connection to create a MySQL Catalog?
> > >>>> 3. Regarding the connector usage examples given in this FLIP:
> > >>>> ```sql
> > >>>> 1  -- Example 2: Using connection for jdbc tables
> > >>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> > >>>> 3  WITH (
> > >>>> 4    'type' = 'jdbc',
> > >>>> 5    'jdbc.url' = 'jdbc:mysql://
> > customer-db.example.com:3306/customerdb',
> > >>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> > >>>> 7  );
> > >>>> 8
> > >>>> 9  CREATE TABLE customers (
> > >>>> 10   customer_id INT,
> > >>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> > >>>> 12 ) WITH (
> > >>>> 13   'connector' = 'jdbc',
> > >>>> 14   'jdbc.connection' = 'mysql_customer_db',
> > >>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> > >>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> > >>>> 17   'jdbc.table-name' = 'customers',
> > >>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> > >>>> 19 );
> > >>>> ```
> > >>>> I see three issues from SQL semantics and Connector compatibility
> > perspectives:
> > >>>> (1) Look at line 14: `mysql_customer_db` is an object identifier of
> a
> > CONNECTION defined in SQL. However, this identifier is referenced
> > >>>>     via a string value inside the table’s WITH clause, which feel
> > hack for me.
> > >>>> (2) Look at lines 14–16: the use of the specific prefix
> > `jdbc.connection` will confuse users because `connection.xx` maybe
> already
> > used as
> > >>>>  a prefix for existing configuration items.
> > >>>> (3) Look at lines 14–18: Why do all existing configuration options
> > need to be prefixed with `jdbc`, even they’re not related to Connection
> > properties?
> > >>>> This completely changes user habits — is it backward compatible?
> > >>>>  In my opinion, Connection should be a model independent of both
> > Catalog and Table, and can be referenced by all catalog/table/udf/model
> > object.
> > >>>> It should be managed by a Component such as a ConnectionManager to
> > enable reuse. For security purposes, authentication mechanisms could
> > >>>> be supported within the ConnectionManager.
> > >>>> Best,
> > >>>> Leonard
> > >>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> > >>>>>
> > >>>>> Hi all,
> > >>>>>
> > >>>>> First of all, I think having a Connection resource is something
> that
> > will
> > >>>>> be beneficial for Apache Flink. I could see that being extended in
> > the
> > >>>>> future to allow for easier secret handling [1].
> > >>>>> In my mental mind, I'm comparing this proposal against SQL/MED from
> > the ISO
> > >>>>> standard [2]. I do think that SQL/MED isn't a very user friendly
> > syntax
> > >>>>> though, looking at Postgres for example [3].
> > >>>>>
> > >>>>> I think it's a valid question if Connection should be considered
> > with a
> > >>>>> catalog or database-level scope. @Ryan can you share something
> more,
> > since
> > >>>>> you've mentioned "Note: I much prefer catalogs for this case. Which
> > is what
> > >>>>> we use internally to manage connection properties". It looks like
> > there
> > >>>>> isn't a strong favourable approach looking at other vendors (like,
> > >>>>> Databricks does scopes it on a Unity catalog, Snowflake on a
> database
> > >>>>> level).
> > >>>>>
> > >>>>> Also looking forward to Leonard's input.
> > >>>>>
> > >>>>> Best regards,
> > >>>>>
> > >>>>> Martijn
> > >>>>>
> > >>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> > >>>>> [2] https://www.iso.org/standard/84804.html
> > >>>>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
> > >>>>>
> > >>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com>
> > wrote:
> > >>>>>
> > >>>>>> Hey Mayank.
> > >>>>>>
> > >>>>>> Thanks for the FLIP, I went through this FLIP quickly and found
> some
> > >>>>>> issues which I think we
> > >>>>>> need to deep discuss later. As we’re on a short Dragon boat
> > Festival,
> > >>>>>> could you kindly hold
> > >>>>>> on this thread? and we will back to continue the FLIP discuss.
> > >>>>>>
> > >>>>>> Best,
> > >>>>>> Leonard
> > >>>>>>
> > >>>>>>
> > >>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> > >>>>>>>
> > >>>>>>> Hi all,
> > >>>>>>>
> > >>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> > >>>>>>>
> > >>>>>>> Motivation:
> > >>>>>>> Currently, Flink SQL handles external connectivity by defining
> > endpoints
> > >>>>>>> and credentials in table configuration. This approach prevents
> > >>>>>> reusability
> > >>>>>>> of these connections and makes table definition less secure by
> > exposing
> > >>>>>>> sensitive information.
> > >>>>>>> We propose the introduction of a new "connection" resource in
> > Flink. This
> > >>>>>>> will be a pluggable resource configured with a remote endpoint
> and
> > >>>>>>> associated access key. Once defined, connections can be reused
> > across
> > >>>>>> table
> > >>>>>>> definitions, and eventually for model definition (as discussed in
> > >>>>>> FLIP-437)
> > >>>>>>> for inference, enabling seamless and secure integration with
> > external
> > >>>>>>> systems.
> > >>>>>>> The connection resource will provide a new, optional way to
> manage
> > >>>>>> external
> > >>>>>>> connectivity in Flink. Existing methods for table definitions
> will
> > remain
> > >>>>>>> unchanged.
> > >>>>>>>
> > >>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> > >>>>>>>
> > >>>>>>> Best Regards,
> > >>>>>>> Mayank Juneja
> > >>>>>>
> > >>>>>>
> > >>>
> > >
> >
> >
>
> --
> *Mayank Juneja*
> Product Manager | Data Streaming and AI
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Mayank Juneja <ma...@gmail.com>.
Hi everyone,

Thanks for your valuable inputs. I have updated the FLIP with the ideas
proposed earlier in the thread. Looking forward to your feedback.
https://cwiki.apache.org/confluence/x/cYroF

Best,
Mayank

On Fri, Jun 27, 2025 at 2:59 AM Leonard Xu <xb...@gmail.com> wrote:

> Quick response, thanks Mayank, Hao and Timo for the effort.  The new
> proposal looks well, +1 from my side.
>
> Could you draft(update) current FLIP docs thus we can have some specific
> discussions later?
>
>
> Best,
> Leonard
>
>
> > 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> >
> > Hi everyone,
> >
> > sorry for the late reply, feature freeze kept me busy. Mayank, Hao and I
> synced offline and came up we an improved proposal. Before we update the
> FLIP let me summarize the most important key facts that hopefully address
> most concerns:
> >
> > 1) SecretStore
> > - Similar to CatalogStore, we introduce a SecretStore as the highest
> level in TableEnvironment.
> > - SecretStore is initialized with options and potentially environment
> variables. Including EnvironmentSettings.withSecretStore(SecretStore).
> > - The SecretStore is pluggable and discovered using the regular
> factory-approach.
> > - For example, it could implement Azure Key Vault or other cloud
> provider secrets stores.
> > - Goal: Flink and Flink catalogs do not have to deal with sensitive data.
> >
> > 2) Connections
> > - Connections are catalog objects identified with 3-part identifiers.
> 3-part identifiers are crucial for managability of larger projects and
> align with existing catalog objects.
> > - They contain connection details, e.g. URL, query parameters, and other
> configuration.
> > - They do not contain secrets, but only pointers to secrets in the
> SecretStore.
> >
> > 3) Connection DDL
> >
> > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
> >  ...
> > )
> >
> > - Connection type is pluggable and discovered using the regular
> factory-approach.
> > - The factory extracts secrets and puts them into SecretStore.
> > - The factory only leaves non-confidential options left that can be
> stored in a catalog.
> >
> > When executing:
> > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >  'type' = 'basic',
> >  'url' = 'api.example.com',
> >  'username' = 'bob',
> >  'password' = 'xyz'
> > )
> >
> > The catalog will receive something similar to:
> > CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
> >  'type' = 'basic',
> >  'url' = 'api.example.com',
> >  'secret.store' = 'azure-key-vault'
> >  'secret.id' = 'secretId'
> > )
> >
> > - However, the exact property design is up to the connection factory.
> >
> > 4) Connection Usage
> >
> > CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> >
> > - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword
> similar to BigQuery.
> > - The connection will be provided in a table/model provider/function
> definition factory.
> >
> > 5) CatalogStore / Catalog Initialization
> >
> > Catalog store or catalog can make use of SecretStore to retrieve initial
> credentials for bootstrapping. All objects lower then catalog store/catalog
> can then use connections. If you think we still need system level
> connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH (..)
> similar to SYSTEM functions directly store in a ConnectioManager in
> TableEnvironment. But for now I would suggest to start simple with
> per-catalog connections and later evolve the design.
> >
> > Dealing with secrets is a very sensitive topic and I'm clearly not an
> expert on it. This is why we should try to push the problem to existing
> solutions and don't start storing secrets in Flink in any way. Thus, the
> interfaces will be defined very generic.
> >
> > Looking forward to your feedback.
> >
> > Cheers,
> > Timo
> >
> >
> >
> >
> >
> > On 09.06.25 04:01, Leonard Xu wrote:
> >> Thanks  Timo for joining this thread.
> >> I agree that this feature is needed by the community; the current
> disagreement is only about the implementation method or solution.
> >> Your thoughts looks generally good to me, looking forward to your
> proposal.
> >> Best,
> >> Leonard
> >>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> >>>
> >>> Hi everyone,
> >>>
> >>> thanks for this healthy discussion. Looking at high number of
> participants, it looks like we definitely want this feature. We just need
> to figure out the "how".
> >>>
> >>> This reminds me very much of the discussion we had for CREATE
> FUNCTION. There, we discussed whether functions should be named globally or
> catalog-specific. In the end, we decided for both `CREATE SYSTEM FUNCTION`
> and `CREATE FUNCTION`, satisfying both the data platform team of an
> organization (which might provide system functions) and individual data
> teams or use cases (scoped by catalog/database).
> >>>
> >>> Looking at other modern vendors like Snowflake there is SECRET (scoped
> to schema) [1] and API INTEGRATION [2] (scoped to account). So also other
> vendors offer global and per-team / per-use case connections details.
> >>>
> >>> In general, I think fitting connections into the existing concepts for
> catalog objects (with three-part identifier) makes managing them easier.
> But I also see the need for global defaults.
> >>>
> >>> Btw keep in mind that a catalog implementation should only store
> metadata. Similar how a CatalogTable doesn't store the actual data, a
> CatalogConnection should not store the credentials. It should only offer a
> factory that allows for storing and retrieving them. In real world
> scenarios a factory is most likely backed by a product like Azure Key Vault.
> >>>
> >>> So code-wise having a ConnectionManager that behaves similar to
> FunctionManager sounds reasonable.
> >>>
> >>> +1 for having special syntax instead of using properties. This allows
> to access connections in tables, models, functions. And catalogs, if we
> agree to have global ones as well.
> >>>
> >>> What do you think?
> >>>
> >>> Let me spend some more thoughts on this and come back with a concrete
> proposal by early next week.
> >>>
> >>> Cheers,
> >>> Timo
> >>>
> >>> [1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
> >>> [2]
> https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> >>>
> >>> On 04.06.25 10:47, Leonard Xu wrote:
> >>>> Hey,Mayank
> >>>> Please see my feedback as following:
> >>>> 1. One of the motivations of this FLIP is to improve security.
> However, the current design stores all connection information in the
> catalog,
> >>>> and each Flink SQL job reads from the catalog during compilation. The
> connection information is passed between SQL Gateway and the
> >>>> catalog in plaintext, which actually introduces new security risks.
> >>>> 2. The name "Connection" should be changed to something like
> ConnectionSpec to clearly indicate that it is a object containing only
> static
> >>>> properties without a lifecycle. Putting aside the naming issue, I
> think the current model and hierarchy design is somewhat strange. Storing
> >>>> various kinds of connections (e.g., Kafka, MySQL) in the same Catalog
> with hierarchical identifiers like catalog-name.db-name.connection-name
> >>>> raises the following questions:
> >>>> (1) What is the purpose of this hierarchical structure of Connection
> object ?
> >>>> (2) If we can use a Connection to create a MySQL table, why can't we
> use a Connection to create a MySQL Catalog?
> >>>> 3. Regarding the connector usage examples given in this FLIP:
> >>>> ```sql
> >>>> 1  -- Example 2: Using connection for jdbc tables
> >>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> >>>> 3  WITH (
> >>>> 4    'type' = 'jdbc',
> >>>> 5    'jdbc.url' = 'jdbc:mysql://
> customer-db.example.com:3306/customerdb',
> >>>> 6    'jdbc.connection.ssl.enabled' = 'true'
> >>>> 7  );
> >>>> 8
> >>>> 9  CREATE TABLE customers (
> >>>> 10   customer_id INT,
> >>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> >>>> 12 ) WITH (
> >>>> 13   'connector' = 'jdbc',
> >>>> 14   'jdbc.connection' = 'mysql_customer_db',
> >>>> 15   'jdbc.connection.ssl.enabled' = 'true',
> >>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
> >>>> 17   'jdbc.table-name' = 'customers',
> >>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
> >>>> 19 );
> >>>> ```
> >>>> I see three issues from SQL semantics and Connector compatibility
> perspectives:
> >>>> (1) Look at line 14: `mysql_customer_db` is an object identifier of a
> CONNECTION defined in SQL. However, this identifier is referenced
> >>>>     via a string value inside the table’s WITH clause, which feel
> hack for me.
> >>>> (2) Look at lines 14–16: the use of the specific prefix
> `jdbc.connection` will confuse users because `connection.xx` maybe already
> used as
> >>>>  a prefix for existing configuration items.
> >>>> (3) Look at lines 14–18: Why do all existing configuration options
> need to be prefixed with `jdbc`, even they’re not related to Connection
> properties?
> >>>> This completely changes user habits — is it backward compatible?
> >>>>  In my opinion, Connection should be a model independent of both
> Catalog and Table, and can be referenced by all catalog/table/udf/model
> object.
> >>>> It should be managed by a Component such as a ConnectionManager to
> enable reuse. For security purposes, authentication mechanisms could
> >>>> be supported within the ConnectionManager.
> >>>> Best,
> >>>> Leonard
> >>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> >>>>>
> >>>>> Hi all,
> >>>>>
> >>>>> First of all, I think having a Connection resource is something that
> will
> >>>>> be beneficial for Apache Flink. I could see that being extended in
> the
> >>>>> future to allow for easier secret handling [1].
> >>>>> In my mental mind, I'm comparing this proposal against SQL/MED from
> the ISO
> >>>>> standard [2]. I do think that SQL/MED isn't a very user friendly
> syntax
> >>>>> though, looking at Postgres for example [3].
> >>>>>
> >>>>> I think it's a valid question if Connection should be considered
> with a
> >>>>> catalog or database-level scope. @Ryan can you share something more,
> since
> >>>>> you've mentioned "Note: I much prefer catalogs for this case. Which
> is what
> >>>>> we use internally to manage connection properties". It looks like
> there
> >>>>> isn't a strong favourable approach looking at other vendors (like,
> >>>>> Databricks does scopes it on a Unity catalog, Snowflake on a database
> >>>>> level).
> >>>>>
> >>>>> Also looking forward to Leonard's input.
> >>>>>
> >>>>> Best regards,
> >>>>>
> >>>>> Martijn
> >>>>>
> >>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
> >>>>> [2] https://www.iso.org/standard/84804.html
> >>>>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
> >>>>>
> >>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com>
> wrote:
> >>>>>
> >>>>>> Hey Mayank.
> >>>>>>
> >>>>>> Thanks for the FLIP, I went through this FLIP quickly and found some
> >>>>>> issues which I think we
> >>>>>> need to deep discuss later. As we’re on a short Dragon boat
> Festival,
> >>>>>> could you kindly hold
> >>>>>> on this thread? and we will back to continue the FLIP discuss.
> >>>>>>
> >>>>>> Best,
> >>>>>> Leonard
> >>>>>>
> >>>>>>
> >>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> >>>>>>>
> >>>>>>> Hi all,
> >>>>>>>
> >>>>>>> I would like to open up for discussion a new FLIP-529 [1].
> >>>>>>>
> >>>>>>> Motivation:
> >>>>>>> Currently, Flink SQL handles external connectivity by defining
> endpoints
> >>>>>>> and credentials in table configuration. This approach prevents
> >>>>>> reusability
> >>>>>>> of these connections and makes table definition less secure by
> exposing
> >>>>>>> sensitive information.
> >>>>>>> We propose the introduction of a new "connection" resource in
> Flink. This
> >>>>>>> will be a pluggable resource configured with a remote endpoint and
> >>>>>>> associated access key. Once defined, connections can be reused
> across
> >>>>>> table
> >>>>>>> definitions, and eventually for model definition (as discussed in
> >>>>>> FLIP-437)
> >>>>>>> for inference, enabling seamless and secure integration with
> external
> >>>>>>> systems.
> >>>>>>> The connection resource will provide a new, optional way to manage
> >>>>>> external
> >>>>>>> connectivity in Flink. Existing methods for table definitions will
> remain
> >>>>>>> unchanged.
> >>>>>>>
> >>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
> >>>>>>>
> >>>>>>> Best Regards,
> >>>>>>> Mayank Juneja
> >>>>>>
> >>>>>>
> >>>
> >
>
>

-- 
*Mayank Juneja*
Product Manager | Data Streaming and AI

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
Quick response, thanks Mayank, Hao and Timo for the effort.  The new proposal looks well, +1 from my side.

Could you draft(update) current FLIP docs thus we can have some specific discussions later?


Best,
Leonard


> 2025 6月 26 15:06,Timo Walther <tw...@apache.org> 写道:
> 
> Hi everyone,
> 
> sorry for the late reply, feature freeze kept me busy. Mayank, Hao and I synced offline and came up we an improved proposal. Before we update the FLIP let me summarize the most important key facts that hopefully address most concerns:
> 
> 1) SecretStore
> - Similar to CatalogStore, we introduce a SecretStore as the highest level in TableEnvironment.
> - SecretStore is initialized with options and potentially environment variables. Including EnvironmentSettings.withSecretStore(SecretStore).
> - The SecretStore is pluggable and discovered using the regular factory-approach.
> - For example, it could implement Azure Key Vault or other cloud provider secrets stores.
> - Goal: Flink and Flink catalogs do not have to deal with sensitive data.
> 
> 2) Connections
> - Connections are catalog objects identified with 3-part identifiers. 3-part identifiers are crucial for managability of larger projects and align with existing catalog objects.
> - They contain connection details, e.g. URL, query parameters, and other configuration.
> - They do not contain secrets, but only pointers to secrets in the SecretStore.
> 
> 3) Connection DDL
> 
> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>  'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
>  ...
> )
> 
> - Connection type is pluggable and discovered using the regular factory-approach.
> - The factory extracts secrets and puts them into SecretStore.
> - The factory only leaves non-confidential options left that can be stored in a catalog.
> 
> When executing:
> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>  'type' = 'basic',
>  'url' = 'api.example.com',
>  'username' = 'bob',
>  'password' = 'xyz'
> )
> 
> The catalog will receive something similar to:
> CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
>  'type' = 'basic',
>  'url' = 'api.example.com',
>  'secret.store' = 'azure-key-vault'
>  'secret.id' = 'secretId'
> )
> 
> - However, the exact property design is up to the connection factory.
> 
> 4) Connection Usage
> 
> CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;
> 
> - MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword similar to BigQuery.
> - The connection will be provided in a table/model provider/function definition factory.
> 
> 5) CatalogStore / Catalog Initialization
> 
> Catalog store or catalog can make use of SecretStore to retrieve initial credentials for bootstrapping. All objects lower then catalog store/catalog can then use connections. If you think we still need system level connections, we can support CREATE SYSTEM CONNECTION GlobalName WITH (..) similar to SYSTEM functions directly store in a ConnectioManager in TableEnvironment. But for now I would suggest to start simple with per-catalog connections and later evolve the design.
> 
> Dealing with secrets is a very sensitive topic and I'm clearly not an expert on it. This is why we should try to push the problem to existing solutions and don't start storing secrets in Flink in any way. Thus, the interfaces will be defined very generic.
> 
> Looking forward to your feedback.
> 
> Cheers,
> Timo
> 
> 
> 
> 
> 
> On 09.06.25 04:01, Leonard Xu wrote:
>> Thanks  Timo for joining this thread.
>> I agree that this feature is needed by the community; the current disagreement is only about the implementation method or solution.
>> Your thoughts looks generally good to me, looking forward to your proposal.
>> Best,
>> Leonard
>>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>>> 
>>> Hi everyone,
>>> 
>>> thanks for this healthy discussion. Looking at high number of participants, it looks like we definitely want this feature. We just need to figure out the "how".
>>> 
>>> This reminds me very much of the discussion we had for CREATE FUNCTION. There, we discussed whether functions should be named globally or catalog-specific. In the end, we decided for both `CREATE SYSTEM FUNCTION` and `CREATE FUNCTION`, satisfying both the data platform team of an organization (which might provide system functions) and individual data teams or use cases (scoped by catalog/database).
>>> 
>>> Looking at other modern vendors like Snowflake there is SECRET (scoped to schema) [1] and API INTEGRATION [2] (scoped to account). So also other vendors offer global and per-team / per-use case connections details.
>>> 
>>> In general, I think fitting connections into the existing concepts for catalog objects (with three-part identifier) makes managing them easier. But I also see the need for global defaults.
>>> 
>>> Btw keep in mind that a catalog implementation should only store metadata. Similar how a CatalogTable doesn't store the actual data, a CatalogConnection should not store the credentials. It should only offer a factory that allows for storing and retrieving them. In real world scenarios a factory is most likely backed by a product like Azure Key Vault.
>>> 
>>> So code-wise having a ConnectionManager that behaves similar to FunctionManager sounds reasonable.
>>> 
>>> +1 for having special syntax instead of using properties. This allows to access connections in tables, models, functions. And catalogs, if we agree to have global ones as well.
>>> 
>>> What do you think?
>>> 
>>> Let me spend some more thoughts on this and come back with a concrete proposal by early next week.
>>> 
>>> Cheers,
>>> Timo
>>> 
>>> [1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
>>> [2] https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>>> 
>>> On 04.06.25 10:47, Leonard Xu wrote:
>>>> Hey,Mayank
>>>> Please see my feedback as following:
>>>> 1. One of the motivations of this FLIP is to improve security. However, the current design stores all connection information in the catalog,
>>>> and each Flink SQL job reads from the catalog during compilation. The connection information is passed between SQL Gateway and the
>>>> catalog in plaintext, which actually introduces new security risks.
>>>> 2. The name "Connection" should be changed to something like ConnectionSpec to clearly indicate that it is a object containing only static
>>>> properties without a lifecycle. Putting aside the naming issue, I think the current model and hierarchy design is somewhat strange. Storing
>>>> various kinds of connections (e.g., Kafka, MySQL) in the same Catalog with hierarchical identifiers like catalog-name.db-name.connection-name
>>>> raises the following questions:
>>>>  (1) What is the purpose of this hierarchical structure of Connection object ?
>>>>  (2) If we can use a Connection to create a MySQL table, why can't we use a Connection to create a MySQL Catalog?
>>>> 3. Regarding the connector usage examples given in this FLIP:
>>>> ```sql
>>>> 1  -- Example 2: Using connection for jdbc tables
>>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>>>> 3  WITH (
>>>> 4    'type' = 'jdbc',
>>>> 5    'jdbc.url' = 'jdbc:mysql://customer-db.example.com:3306/customerdb',
>>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>>>> 7  );
>>>> 8
>>>> 9  CREATE TABLE customers (
>>>> 10   customer_id INT,
>>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>>>> 12 ) WITH (
>>>> 13   'connector' = 'jdbc',
>>>> 14   'jdbc.connection' = 'mysql_customer_db',
>>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>>>> 17   'jdbc.table-name' = 'customers',
>>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>>>> 19 );
>>>> ```
>>>> I see three issues from SQL semantics and Connector compatibility perspectives:
>>>> (1) Look at line 14: `mysql_customer_db` is an object identifier of a CONNECTION defined in SQL. However, this identifier is referenced
>>>>     via a string value inside the table’s WITH clause, which feel hack for me.
>>>> (2) Look at lines 14–16: the use of the specific prefix `jdbc.connection` will confuse users because `connection.xx` maybe already used as
>>>>  a prefix for existing configuration items.
>>>> (3) Look at lines 14–18: Why do all existing configuration options need to be prefixed with `jdbc`, even they’re not related to Connection properties?
>>>> This completely changes user habits — is it backward compatible?
>>>>  In my opinion, Connection should be a model independent of both Catalog and Table, and can be referenced by all catalog/table/udf/model object.
>>>> It should be managed by a Component such as a ConnectionManager to enable reuse. For security purposes, authentication mechanisms could
>>>> be supported within the ConnectionManager.
>>>> Best,
>>>> Leonard
>>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
>>>>> 
>>>>> Hi all,
>>>>> 
>>>>> First of all, I think having a Connection resource is something that will
>>>>> be beneficial for Apache Flink. I could see that being extended in the
>>>>> future to allow for easier secret handling [1].
>>>>> In my mental mind, I'm comparing this proposal against SQL/MED from the ISO
>>>>> standard [2]. I do think that SQL/MED isn't a very user friendly syntax
>>>>> though, looking at Postgres for example [3].
>>>>> 
>>>>> I think it's a valid question if Connection should be considered with a
>>>>> catalog or database-level scope. @Ryan can you share something more, since
>>>>> you've mentioned "Note: I much prefer catalogs for this case. Which is what
>>>>> we use internally to manage connection properties". It looks like there
>>>>> isn't a strong favourable approach looking at other vendors (like,
>>>>> Databricks does scopes it on a Unity catalog, Snowflake on a database
>>>>> level).
>>>>> 
>>>>> Also looking forward to Leonard's input.
>>>>> 
>>>>> Best regards,
>>>>> 
>>>>> Martijn
>>>>> 
>>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>>>> [2] https://www.iso.org/standard/84804.html
>>>>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
>>>>> 
>>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
>>>>> 
>>>>>> Hey Mayank.
>>>>>> 
>>>>>> Thanks for the FLIP, I went through this FLIP quickly and found some
>>>>>> issues which I think we
>>>>>> need to deep discuss later. As we’re on a short Dragon boat Festival,
>>>>>> could you kindly hold
>>>>>> on this thread? and we will back to continue the FLIP discuss.
>>>>>> 
>>>>>> Best,
>>>>>> Leonard
>>>>>> 
>>>>>> 
>>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
>>>>>>> 
>>>>>>> Hi all,
>>>>>>> 
>>>>>>> I would like to open up for discussion a new FLIP-529 [1].
>>>>>>> 
>>>>>>> Motivation:
>>>>>>> Currently, Flink SQL handles external connectivity by defining endpoints
>>>>>>> and credentials in table configuration. This approach prevents
>>>>>> reusability
>>>>>>> of these connections and makes table definition less secure by exposing
>>>>>>> sensitive information.
>>>>>>> We propose the introduction of a new "connection" resource in Flink. This
>>>>>>> will be a pluggable resource configured with a remote endpoint and
>>>>>>> associated access key. Once defined, connections can be reused across
>>>>>> table
>>>>>>> definitions, and eventually for model definition (as discussed in
>>>>>> FLIP-437)
>>>>>>> for inference, enabling seamless and secure integration with external
>>>>>>> systems.
>>>>>>> The connection resource will provide a new, optional way to manage
>>>>>> external
>>>>>>> connectivity in Flink. Existing methods for table definitions will remain
>>>>>>> unchanged.
>>>>>>> 
>>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>>>> 
>>>>>>> Best Regards,
>>>>>>> Mayank Juneja
>>>>>> 
>>>>>> 
>>> 
> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Timo Walther <tw...@apache.org>.
Hi everyone,

sorry for the late reply, feature freeze kept me busy. Mayank, Hao and I 
synced offline and came up we an improved proposal. Before we update the 
FLIP let me summarize the most important key facts that hopefully 
address most concerns:

1) SecretStore
- Similar to CatalogStore, we introduce a SecretStore as the highest 
level in TableEnvironment.
- SecretStore is initialized with options and potentially environment 
variables. Including EnvironmentSettings.withSecretStore(SecretStore).
- The SecretStore is pluggable and discovered using the regular 
factory-approach.
- For example, it could implement Azure Key Vault or other cloud 
provider secrets stores.
- Goal: Flink and Flink catalogs do not have to deal with sensitive data.

2) Connections
- Connections are catalog objects identified with 3-part identifiers. 
3-part identifiers are crucial for managability of larger projects and 
align with existing catalog objects.
- They contain connection details, e.g. URL, query parameters, and other 
configuration.
- They do not contain secrets, but only pointers to secrets in the 
SecretStore.

3) Connection DDL

CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
   'type' = 'basic' | 'bearer' | 'jwt' | 'oauth' | ...,
   ...
)

- Connection type is pluggable and discovered using the regular 
factory-approach.
- The factory extracts secrets and puts them into SecretStore.
- The factory only leaves non-confidential options left that can be 
stored in a catalog.

When executing:
CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
   'type' = 'basic',
   'url' = 'api.example.com',
   'username' = 'bob',
   'password' = 'xyz'
)

The catalog will receive something similar to:
CREATE [TEMPORARY] CONNECTION mycat.mydb.OpenAPI WITH (
   'type' = 'basic',
   'url' = 'api.example.com',
   'secret.store' = 'azure-key-vault'
   'secret.id' = 'secretId'
)

- However, the exact property design is up to the connection factory.

4) Connection Usage

CREATE TABLE t (...) USING CONNECTION mycat.mydb.OpenAPI;

- MODEL, FUNCTION, TABLE DDL will support USING CONNECTION keyword 
similar to BigQuery.
- The connection will be provided in a table/model provider/function 
definition factory.

5) CatalogStore / Catalog Initialization

Catalog store or catalog can make use of SecretStore to retrieve initial 
credentials for bootstrapping. All objects lower then catalog 
store/catalog can then use connections. If you think we still need 
system level connections, we can support CREATE SYSTEM CONNECTION 
GlobalName WITH (..) similar to SYSTEM functions directly store in a 
ConnectioManager in TableEnvironment. But for now I would suggest to 
start simple with per-catalog connections and later evolve the design.

Dealing with secrets is a very sensitive topic and I'm clearly not an 
expert on it. This is why we should try to push the problem to existing 
solutions and don't start storing secrets in Flink in any way. Thus, the 
interfaces will be defined very generic.

Looking forward to your feedback.

Cheers,
Timo





On 09.06.25 04:01, Leonard Xu wrote:
> Thanks  Timo for joining this thread.
> 
> I agree that this feature is needed by the community; the current disagreement is only about the implementation method or solution.
> Your thoughts looks generally good to me, looking forward to your proposal.
> 
> Best,
> Leonard
> 
>> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
>>
>> Hi everyone,
>>
>> thanks for this healthy discussion. Looking at high number of participants, it looks like we definitely want this feature. We just need to figure out the "how".
>>
>> This reminds me very much of the discussion we had for CREATE FUNCTION. There, we discussed whether functions should be named globally or catalog-specific. In the end, we decided for both `CREATE SYSTEM FUNCTION` and `CREATE FUNCTION`, satisfying both the data platform team of an organization (which might provide system functions) and individual data teams or use cases (scoped by catalog/database).
>>
>> Looking at other modern vendors like Snowflake there is SECRET (scoped to schema) [1] and API INTEGRATION [2] (scoped to account). So also other vendors offer global and per-team / per-use case connections details.
>>
>> In general, I think fitting connections into the existing concepts for catalog objects (with three-part identifier) makes managing them easier. But I also see the need for global defaults.
>>
>> Btw keep in mind that a catalog implementation should only store metadata. Similar how a CatalogTable doesn't store the actual data, a CatalogConnection should not store the credentials. It should only offer a factory that allows for storing and retrieving them. In real world scenarios a factory is most likely backed by a product like Azure Key Vault.
>>
>> So code-wise having a ConnectionManager that behaves similar to FunctionManager sounds reasonable.
>>
>> +1 for having special syntax instead of using properties. This allows to access connections in tables, models, functions. And catalogs, if we agree to have global ones as well.
>>
>> What do you think?
>>
>> Let me spend some more thoughts on this and come back with a concrete proposal by early next week.
>>
>> Cheers,
>> Timo
>>
>> [1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
>> [2] https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
>>
>> On 04.06.25 10:47, Leonard Xu wrote:
>>> Hey,Mayank
>>> Please see my feedback as following:
>>> 1. One of the motivations of this FLIP is to improve security. However, the current design stores all connection information in the catalog,
>>> and each Flink SQL job reads from the catalog during compilation. The connection information is passed between SQL Gateway and the
>>> catalog in plaintext, which actually introduces new security risks.
>>> 2. The name "Connection" should be changed to something like ConnectionSpec to clearly indicate that it is a object containing only static
>>> properties without a lifecycle. Putting aside the naming issue, I think the current model and hierarchy design is somewhat strange. Storing
>>> various kinds of connections (e.g., Kafka, MySQL) in the same Catalog with hierarchical identifiers like catalog-name.db-name.connection-name
>>> raises the following questions:
>>>  (1) What is the purpose of this hierarchical structure of Connection object ?
>>>  (2) If we can use a Connection to create a MySQL table, why can't we use a Connection to create a MySQL Catalog?
>>> 3. Regarding the connector usage examples given in this FLIP:
>>> ```sql
>>> 1  -- Example 2: Using connection for jdbc tables
>>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>>> 3  WITH (
>>> 4    'type' = 'jdbc',
>>> 5    'jdbc.url' = 'jdbc:mysql://customer-db.example.com:3306/customerdb',
>>> 6    'jdbc.connection.ssl.enabled' = 'true'
>>> 7  );
>>> 8
>>> 9  CREATE TABLE customers (
>>> 10   customer_id INT,
>>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>>> 12 ) WITH (
>>> 13   'connector' = 'jdbc',
>>> 14   'jdbc.connection' = 'mysql_customer_db',
>>> 15   'jdbc.connection.ssl.enabled' = 'true',
>>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>>> 17   'jdbc.table-name' = 'customers',
>>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>>> 19 );
>>> ```
>>> I see three issues from SQL semantics and Connector compatibility perspectives:
>>> (1) Look at line 14: `mysql_customer_db` is an object identifier of a CONNECTION defined in SQL. However, this identifier is referenced
>>>      via a string value inside the table’s WITH clause, which feel hack for me.
>>> (2) Look at lines 14–16: the use of the specific prefix `jdbc.connection` will confuse users because `connection.xx` maybe already used as
>>>   a prefix for existing configuration items.
>>> (3) Look at lines 14–18: Why do all existing configuration options need to be prefixed with `jdbc`, even they’re not related to Connection properties?
>>> This completely changes user habits — is it backward compatible?
>>>   In my opinion, Connection should be a model independent of both Catalog and Table, and can be referenced by all catalog/table/udf/model object.
>>> It should be managed by a Component such as a ConnectionManager to enable reuse. For security purposes, authentication mechanisms could
>>> be supported within the ConnectionManager.
>>> Best,
>>> Leonard
>>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
>>>>
>>>> Hi all,
>>>>
>>>> First of all, I think having a Connection resource is something that will
>>>> be beneficial for Apache Flink. I could see that being extended in the
>>>> future to allow for easier secret handling [1].
>>>> In my mental mind, I'm comparing this proposal against SQL/MED from the ISO
>>>> standard [2]. I do think that SQL/MED isn't a very user friendly syntax
>>>> though, looking at Postgres for example [3].
>>>>
>>>> I think it's a valid question if Connection should be considered with a
>>>> catalog or database-level scope. @Ryan can you share something more, since
>>>> you've mentioned "Note: I much prefer catalogs for this case. Which is what
>>>> we use internally to manage connection properties". It looks like there
>>>> isn't a strong favourable approach looking at other vendors (like,
>>>> Databricks does scopes it on a Unity catalog, Snowflake on a database
>>>> level).
>>>>
>>>> Also looking forward to Leonard's input.
>>>>
>>>> Best regards,
>>>>
>>>> Martijn
>>>>
>>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>>> [2] https://www.iso.org/standard/84804.html
>>>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
>>>>
>>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
>>>>
>>>>> Hey Mayank.
>>>>>
>>>>> Thanks for the FLIP, I went through this FLIP quickly and found some
>>>>> issues which I think we
>>>>> need to deep discuss later. As we’re on a short Dragon boat Festival,
>>>>> could you kindly hold
>>>>> on this thread? and we will back to continue the FLIP discuss.
>>>>>
>>>>> Best,
>>>>> Leonard
>>>>>
>>>>>
>>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
>>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I would like to open up for discussion a new FLIP-529 [1].
>>>>>>
>>>>>> Motivation:
>>>>>> Currently, Flink SQL handles external connectivity by defining endpoints
>>>>>> and credentials in table configuration. This approach prevents
>>>>> reusability
>>>>>> of these connections and makes table definition less secure by exposing
>>>>>> sensitive information.
>>>>>> We propose the introduction of a new "connection" resource in Flink. This
>>>>>> will be a pluggable resource configured with a remote endpoint and
>>>>>> associated access key. Once defined, connections can be reused across
>>>>> table
>>>>>> definitions, and eventually for model definition (as discussed in
>>>>> FLIP-437)
>>>>>> for inference, enabling seamless and secure integration with external
>>>>>> systems.
>>>>>> The connection resource will provide a new, optional way to manage
>>>>> external
>>>>>> connectivity in Flink. Existing methods for table definitions will remain
>>>>>> unchanged.
>>>>>>
>>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>>>
>>>>>> Best Regards,
>>>>>> Mayank Juneja
>>>>>
>>>>>
>>
> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
Thanks  Timo for joining this thread.

I agree that this feature is needed by the community; the current disagreement is only about the implementation method or solution. 
Your thoughts looks generally good to me, looking forward to your proposal. 

Best,
Leonard

> 2025 6月 6 22:46,Timo Walther <tw...@apache.org> 写道:
> 
> Hi everyone,
> 
> thanks for this healthy discussion. Looking at high number of participants, it looks like we definitely want this feature. We just need to figure out the "how".
> 
> This reminds me very much of the discussion we had for CREATE FUNCTION. There, we discussed whether functions should be named globally or catalog-specific. In the end, we decided for both `CREATE SYSTEM FUNCTION` and `CREATE FUNCTION`, satisfying both the data platform team of an organization (which might provide system functions) and individual data teams or use cases (scoped by catalog/database).
> 
> Looking at other modern vendors like Snowflake there is SECRET (scoped to schema) [1] and API INTEGRATION [2] (scoped to account). So also other vendors offer global and per-team / per-use case connections details.
> 
> In general, I think fitting connections into the existing concepts for catalog objects (with three-part identifier) makes managing them easier. But I also see the need for global defaults.
> 
> Btw keep in mind that a catalog implementation should only store metadata. Similar how a CatalogTable doesn't store the actual data, a CatalogConnection should not store the credentials. It should only offer a factory that allows for storing and retrieving them. In real world scenarios a factory is most likely backed by a product like Azure Key Vault.
> 
> So code-wise having a ConnectionManager that behaves similar to FunctionManager sounds reasonable.
> 
> +1 for having special syntax instead of using properties. This allows to access connections in tables, models, functions. And catalogs, if we agree to have global ones as well.
> 
> What do you think?
> 
> Let me spend some more thoughts on this and come back with a concrete proposal by early next week.
> 
> Cheers,
> Timo
> 
> [1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
> [2] https://docs.snowflake.com/en/sql-reference/sql/create-api-integration
> 
> On 04.06.25 10:47, Leonard Xu wrote:
>> Hey,Mayank
>> Please see my feedback as following:
>> 1. One of the motivations of this FLIP is to improve security. However, the current design stores all connection information in the catalog,
>> and each Flink SQL job reads from the catalog during compilation. The connection information is passed between SQL Gateway and the
>> catalog in plaintext, which actually introduces new security risks.
>> 2. The name "Connection" should be changed to something like ConnectionSpec to clearly indicate that it is a object containing only static
>> properties without a lifecycle. Putting aside the naming issue, I think the current model and hierarchy design is somewhat strange. Storing
>> various kinds of connections (e.g., Kafka, MySQL) in the same Catalog with hierarchical identifiers like catalog-name.db-name.connection-name
>> raises the following questions:
>>  (1) What is the purpose of this hierarchical structure of Connection object ?
>>  (2) If we can use a Connection to create a MySQL table, why can't we use a Connection to create a MySQL Catalog?
>> 3. Regarding the connector usage examples given in this FLIP:
>> ```sql
>> 1  -- Example 2: Using connection for jdbc tables
>> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
>> 3  WITH (
>> 4    'type' = 'jdbc',
>> 5    'jdbc.url' = 'jdbc:mysql://customer-db.example.com:3306/customerdb',
>> 6    'jdbc.connection.ssl.enabled' = 'true'
>> 7  );
>> 8
>> 9  CREATE TABLE customers (
>> 10   customer_id INT,
>> 11   PRIMARY KEY (customer_id) NOT ENFORCED
>> 12 ) WITH (
>> 13   'connector' = 'jdbc',
>> 14   'jdbc.connection' = 'mysql_customer_db',
>> 15   'jdbc.connection.ssl.enabled' = 'true',
>> 16   'jdbc.connection.max-retry-timeout' = '60s',
>> 17   'jdbc.table-name' = 'customers',
>> 18   'jdbc.lookup.cache' = 'PARTIAL'
>> 19 );
>> ```
>> I see three issues from SQL semantics and Connector compatibility perspectives:
>> (1) Look at line 14: `mysql_customer_db` is an object identifier of a CONNECTION defined in SQL. However, this identifier is referenced
>>     via a string value inside the table’s WITH clause, which feel hack for me.
>> (2) Look at lines 14–16: the use of the specific prefix `jdbc.connection` will confuse users because `connection.xx` maybe already used as
>>  a prefix for existing configuration items.
>> (3) Look at lines 14–18: Why do all existing configuration options need to be prefixed with `jdbc`, even they’re not related to Connection properties?
>> This completely changes user habits — is it backward compatible?
>>  In my opinion, Connection should be a model independent of both Catalog and Table, and can be referenced by all catalog/table/udf/model object.
>> It should be managed by a Component such as a ConnectionManager to enable reuse. For security purposes, authentication mechanisms could
>> be supported within the ConnectionManager.
>> Best,
>> Leonard
>>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
>>> 
>>> Hi all,
>>> 
>>> First of all, I think having a Connection resource is something that will
>>> be beneficial for Apache Flink. I could see that being extended in the
>>> future to allow for easier secret handling [1].
>>> In my mental mind, I'm comparing this proposal against SQL/MED from the ISO
>>> standard [2]. I do think that SQL/MED isn't a very user friendly syntax
>>> though, looking at Postgres for example [3].
>>> 
>>> I think it's a valid question if Connection should be considered with a
>>> catalog or database-level scope. @Ryan can you share something more, since
>>> you've mentioned "Note: I much prefer catalogs for this case. Which is what
>>> we use internally to manage connection properties". It looks like there
>>> isn't a strong favourable approach looking at other vendors (like,
>>> Databricks does scopes it on a Unity catalog, Snowflake on a database
>>> level).
>>> 
>>> Also looking forward to Leonard's input.
>>> 
>>> Best regards,
>>> 
>>> Martijn
>>> 
>>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>>> [2] https://www.iso.org/standard/84804.html
>>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
>>> 
>>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
>>> 
>>>> Hey Mayank.
>>>> 
>>>> Thanks for the FLIP, I went through this FLIP quickly and found some
>>>> issues which I think we
>>>> need to deep discuss later. As we’re on a short Dragon boat Festival,
>>>> could you kindly hold
>>>> on this thread? and we will back to continue the FLIP discuss.
>>>> 
>>>> Best,
>>>> Leonard
>>>> 
>>>> 
>>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
>>>>> 
>>>>> Hi all,
>>>>> 
>>>>> I would like to open up for discussion a new FLIP-529 [1].
>>>>> 
>>>>> Motivation:
>>>>> Currently, Flink SQL handles external connectivity by defining endpoints
>>>>> and credentials in table configuration. This approach prevents
>>>> reusability
>>>>> of these connections and makes table definition less secure by exposing
>>>>> sensitive information.
>>>>> We propose the introduction of a new "connection" resource in Flink. This
>>>>> will be a pluggable resource configured with a remote endpoint and
>>>>> associated access key. Once defined, connections can be reused across
>>>> table
>>>>> definitions, and eventually for model definition (as discussed in
>>>> FLIP-437)
>>>>> for inference, enabling seamless and secure integration with external
>>>>> systems.
>>>>> The connection resource will provide a new, optional way to manage
>>>> external
>>>>> connectivity in Flink. Existing methods for table definitions will remain
>>>>> unchanged.
>>>>> 
>>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>> 
>>>>> Best Regards,
>>>>> Mayank Juneja
>>>> 
>>>> 
> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Timo Walther <tw...@apache.org>.
Hi everyone,

thanks for this healthy discussion. Looking at high number of 
participants, it looks like we definitely want this feature. We just 
need to figure out the "how".

This reminds me very much of the discussion we had for CREATE FUNCTION. 
There, we discussed whether functions should be named globally or 
catalog-specific. In the end, we decided for both `CREATE SYSTEM 
FUNCTION` and `CREATE FUNCTION`, satisfying both the data platform team 
of an organization (which might provide system functions) and individual 
data teams or use cases (scoped by catalog/database).

Looking at other modern vendors like Snowflake there is SECRET (scoped 
to schema) [1] and API INTEGRATION [2] (scoped to account). So also 
other vendors offer global and per-team / per-use case connections details.

In general, I think fitting connections into the existing concepts for 
catalog objects (with three-part identifier) makes managing them easier. 
But I also see the need for global defaults.

Btw keep in mind that a catalog implementation should only store 
metadata. Similar how a CatalogTable doesn't store the actual data, a 
CatalogConnection should not store the credentials. It should only offer 
a factory that allows for storing and retrieving them. In real world 
scenarios a factory is most likely backed by a product like Azure Key Vault.

So code-wise having a ConnectionManager that behaves similar to 
FunctionManager sounds reasonable.

+1 for having special syntax instead of using properties. This allows to 
access connections in tables, models, functions. And catalogs, if we 
agree to have global ones as well.

What do you think?

Let me spend some more thoughts on this and come back with a concrete 
proposal by early next week.

Cheers,
Timo

[1] https://docs.snowflake.com/en/sql-reference/sql/create-secret
[2] https://docs.snowflake.com/en/sql-reference/sql/create-api-integration

On 04.06.25 10:47, Leonard Xu wrote:
> Hey,Mayank
> 
> Please see my feedback as following:
> 
> 1. One of the motivations of this FLIP is to improve security. However, the current design stores all connection information in the catalog,
> and each Flink SQL job reads from the catalog during compilation. The connection information is passed between SQL Gateway and the
> catalog in plaintext, which actually introduces new security risks.
> 
> 2. The name "Connection" should be changed to something like ConnectionSpec to clearly indicate that it is a object containing only static
> properties without a lifecycle. Putting aside the naming issue, I think the current model and hierarchy design is somewhat strange. Storing
> various kinds of connections (e.g., Kafka, MySQL) in the same Catalog with hierarchical identifiers like catalog-name.db-name.connection-name
> raises the following questions:
>  (1) What is the purpose of this hierarchical structure of Connection object ?
>  (2) If we can use a Connection to create a MySQL table, why can't we use a Connection to create a MySQL Catalog?
> 
> 3. Regarding the connector usage examples given in this FLIP:
> ```sql
> 1  -- Example 2: Using connection for jdbc tables
> 2  CREATE OR REPLACE CONNECTION mysql_customer_db
> 3  WITH (
> 4    'type' = 'jdbc',
> 5    'jdbc.url' = 'jdbc:mysql://customer-db.example.com:3306/customerdb',
> 6    'jdbc.connection.ssl.enabled' = 'true'
> 7  );
> 8
> 9  CREATE TABLE customers (
> 10   customer_id INT,
> 11   PRIMARY KEY (customer_id) NOT ENFORCED
> 12 ) WITH (
> 13   'connector' = 'jdbc',
> 14   'jdbc.connection' = 'mysql_customer_db',
> 15   'jdbc.connection.ssl.enabled' = 'true',
> 16   'jdbc.connection.max-retry-timeout' = '60s',
> 17   'jdbc.table-name' = 'customers',
> 18   'jdbc.lookup.cache' = 'PARTIAL'
> 19 );
> ```
> I see three issues from SQL semantics and Connector compatibility perspectives:
> 
> (1) Look at line 14: `mysql_customer_db` is an object identifier of a CONNECTION defined in SQL. However, this identifier is referenced
>      via a string value inside the table’s WITH clause, which feel hack for me.
> 
> (2) Look at lines 14–16: the use of the specific prefix `jdbc.connection` will confuse users because `connection.xx` maybe already used as
>   a prefix for existing configuration items.
> 
> (3) Look at lines 14–18: Why do all existing configuration options need to be prefixed with `jdbc`, even they’re not related to Connection properties?
> This completely changes user habits — is it backward compatible?
>   
> In my opinion, Connection should be a model independent of both Catalog and Table, and can be referenced by all catalog/table/udf/model object.
> It should be managed by a Component such as a ConnectionManager to enable reuse. For security purposes, authentication mechanisms could
> be supported within the ConnectionManager.
> 
> Best,
> Leonard
> 
> 
>> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
>>
>> Hi all,
>>
>> First of all, I think having a Connection resource is something that will
>> be beneficial for Apache Flink. I could see that being extended in the
>> future to allow for easier secret handling [1].
>> In my mental mind, I'm comparing this proposal against SQL/MED from the ISO
>> standard [2]. I do think that SQL/MED isn't a very user friendly syntax
>> though, looking at Postgres for example [3].
>>
>> I think it's a valid question if Connection should be considered with a
>> catalog or database-level scope. @Ryan can you share something more, since
>> you've mentioned "Note: I much prefer catalogs for this case. Which is what
>> we use internally to manage connection properties". It looks like there
>> isn't a strong favourable approach looking at other vendors (like,
>> Databricks does scopes it on a Unity catalog, Snowflake on a database
>> level).
>>
>> Also looking forward to Leonard's input.
>>
>> Best regards,
>>
>> Martijn
>>
>> [1] https://issues.apache.org/jira/browse/FLINK-36818
>> [2] https://www.iso.org/standard/84804.html
>> [3] https://www.postgresql.org/docs/current/sql-createserver.html
>>
>> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
>>
>>> Hey Mayank.
>>>
>>> Thanks for the FLIP, I went through this FLIP quickly and found some
>>> issues which I think we
>>> need to deep discuss later. As we’re on a short Dragon boat Festival,
>>> could you kindly hold
>>> on this thread? and we will back to continue the FLIP discuss.
>>>
>>> Best,
>>> Leonard
>>>
>>>
>>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
>>>>
>>>> Hi all,
>>>>
>>>> I would like to open up for discussion a new FLIP-529 [1].
>>>>
>>>> Motivation:
>>>> Currently, Flink SQL handles external connectivity by defining endpoints
>>>> and credentials in table configuration. This approach prevents
>>> reusability
>>>> of these connections and makes table definition less secure by exposing
>>>> sensitive information.
>>>> We propose the introduction of a new "connection" resource in Flink. This
>>>> will be a pluggable resource configured with a remote endpoint and
>>>> associated access key. Once defined, connections can be reused across
>>> table
>>>> definitions, and eventually for model definition (as discussed in
>>> FLIP-437)
>>>> for inference, enabling seamless and secure integration with external
>>>> systems.
>>>> The connection resource will provide a new, optional way to manage
>>> external
>>>> connectivity in Flink. Existing methods for table definitions will remain
>>>> unchanged.
>>>>
>>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>>>
>>>> Best Regards,
>>>> Mayank Juneja
>>>
>>>
> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
Hey,Mayank

Please see my feedback as following:

1. One of the motivations of this FLIP is to improve security. However, the current design stores all connection information in the catalog, 
and each Flink SQL job reads from the catalog during compilation. The connection information is passed between SQL Gateway and the 
catalog in plaintext, which actually introduces new security risks.

2. The name "Connection" should be changed to something like ConnectionSpec to clearly indicate that it is a object containing only static 
properties without a lifecycle. Putting aside the naming issue, I think the current model and hierarchy design is somewhat strange. Storing
various kinds of connections (e.g., Kafka, MySQL) in the same Catalog with hierarchical identifiers like catalog-name.db-name.connection-name
raises the following questions:  
 (1) What is the purpose of this hierarchical structure of Connection object ?  
 (2) If we can use a Connection to create a MySQL table, why can't we use a Connection to create a MySQL Catalog?  

3. Regarding the connector usage examples given in this FLIP:
```sql
1  -- Example 2: Using connection for jdbc tables 
2  CREATE OR REPLACE CONNECTION mysql_customer_db
3  WITH (
4    'type' = 'jdbc',
5    'jdbc.url' = 'jdbc:mysql://customer-db.example.com:3306/customerdb',
6    'jdbc.connection.ssl.enabled' = 'true'
7  );
8  
9  CREATE TABLE customers (
10   customer_id INT,
11   PRIMARY KEY (customer_id) NOT ENFORCED
12 ) WITH (
13   'connector' = 'jdbc',
14   'jdbc.connection' = 'mysql_customer_db',
15   'jdbc.connection.ssl.enabled' = 'true',
16   'jdbc.connection.max-retry-timeout' = '60s',
17   'jdbc.table-name' = 'customers',
18   'jdbc.lookup.cache' = 'PARTIAL'
19 );
```
I see three issues from SQL semantics and Connector compatibility perspectives:

(1) Look at line 14: `mysql_customer_db` is an object identifier of a CONNECTION defined in SQL. However, this identifier is referenced
    via a string value inside the table’s WITH clause, which feel hack for me.

(2) Look at lines 14–16: the use of the specific prefix `jdbc.connection` will confuse users because `connection.xx` maybe already used as
 a prefix for existing configuration items.

(3) Look at lines 14–18: Why do all existing configuration options need to be prefixed with `jdbc`, even they’re not related to Connection properties?
This completely changes user habits — is it backward compatible?
 
In my opinion, Connection should be a model independent of both Catalog and Table, and can be referenced by all catalog/table/udf/model object. 
It should be managed by a Component such as a ConnectionManager to enable reuse. For security purposes, authentication mechanisms could 
be supported within the ConnectionManager.

Best,
Leonard


> 2025 6月 4 02:04,Martijn Visser <ma...@apache.org> 写道:
> 
> Hi all,
> 
> First of all, I think having a Connection resource is something that will
> be beneficial for Apache Flink. I could see that being extended in the
> future to allow for easier secret handling [1].
> In my mental mind, I'm comparing this proposal against SQL/MED from the ISO
> standard [2]. I do think that SQL/MED isn't a very user friendly syntax
> though, looking at Postgres for example [3].
> 
> I think it's a valid question if Connection should be considered with a
> catalog or database-level scope. @Ryan can you share something more, since
> you've mentioned "Note: I much prefer catalogs for this case. Which is what
> we use internally to manage connection properties". It looks like there
> isn't a strong favourable approach looking at other vendors (like,
> Databricks does scopes it on a Unity catalog, Snowflake on a database
> level).
> 
> Also looking forward to Leonard's input.
> 
> Best regards,
> 
> Martijn
> 
> [1] https://issues.apache.org/jira/browse/FLINK-36818
> [2] https://www.iso.org/standard/84804.html
> [3] https://www.postgresql.org/docs/current/sql-createserver.html
> 
> On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:
> 
>> Hey Mayank.
>> 
>> Thanks for the FLIP, I went through this FLIP quickly and found some
>> issues which I think we
>> need to deep discuss later. As we’re on a short Dragon boat Festival,
>> could you kindly hold
>> on this thread? and we will back to continue the FLIP discuss.
>> 
>> Best,
>> Leonard
>> 
>> 
>>> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
>>> 
>>> Hi all,
>>> 
>>> I would like to open up for discussion a new FLIP-529 [1].
>>> 
>>> Motivation:
>>> Currently, Flink SQL handles external connectivity by defining endpoints
>>> and credentials in table configuration. This approach prevents
>> reusability
>>> of these connections and makes table definition less secure by exposing
>>> sensitive information.
>>> We propose the introduction of a new "connection" resource in Flink. This
>>> will be a pluggable resource configured with a remote endpoint and
>>> associated access key. Once defined, connections can be reused across
>> table
>>> definitions, and eventually for model definition (as discussed in
>> FLIP-437)
>>> for inference, enabling seamless and secure integration with external
>>> systems.
>>> The connection resource will provide a new, optional way to manage
>> external
>>> connectivity in Flink. Existing methods for table definitions will remain
>>> unchanged.
>>> 
>>> [1] https://cwiki.apache.org/confluence/x/cYroF
>>> 
>>> Best Regards,
>>> Mayank Juneja
>> 
>> 


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Martijn Visser <ma...@apache.org>.
Hi all,

First of all, I think having a Connection resource is something that will
be beneficial for Apache Flink. I could see that being extended in the
future to allow for easier secret handling [1].
In my mental mind, I'm comparing this proposal against SQL/MED from the ISO
standard [2]. I do think that SQL/MED isn't a very user friendly syntax
though, looking at Postgres for example [3].

I think it's a valid question if Connection should be considered with a
catalog or database-level scope. @Ryan can you share something more, since
you've mentioned "Note: I much prefer catalogs for this case. Which is what
we use internally to manage connection properties". It looks like there
isn't a strong favourable approach looking at other vendors (like,
Databricks does scopes it on a Unity catalog, Snowflake on a database
level).

Also looking forward to Leonard's input.

Best regards,

Martijn

[1] https://issues.apache.org/jira/browse/FLINK-36818
[2] https://www.iso.org/standard/84804.html
[3] https://www.postgresql.org/docs/current/sql-createserver.html

On Fri, May 30, 2025 at 5:07 AM Leonard Xu <xb...@gmail.com> wrote:

> Hey Mayank.
>
> Thanks for the FLIP, I went through this FLIP quickly and found some
> issues which I think we
> need to deep discuss later. As we’re on a short Dragon boat Festival,
> could you kindly hold
> on this thread? and we will back to continue the FLIP discuss.
>
> Best,
> Leonard
>
>
> > 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> >
> > Hi all,
> >
> > I would like to open up for discussion a new FLIP-529 [1].
> >
> > Motivation:
> > Currently, Flink SQL handles external connectivity by defining endpoints
> > and credentials in table configuration. This approach prevents
> reusability
> > of these connections and makes table definition less secure by exposing
> > sensitive information.
> > We propose the introduction of a new "connection" resource in Flink. This
> > will be a pluggable resource configured with a remote endpoint and
> > associated access key. Once defined, connections can be reused across
> table
> > definitions, and eventually for model definition (as discussed in
> FLIP-437)
> > for inference, enabling seamless and secure integration with external
> > systems.
> > The connection resource will provide a new, optional way to manage
> external
> > connectivity in Flink. Existing methods for table definitions will remain
> > unchanged.
> >
> > [1] https://cwiki.apache.org/confluence/x/cYroF
> >
> > Best Regards,
> > Mayank Juneja
>
>

Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Leonard Xu <xb...@gmail.com>.
Hey Mayank.

Thanks for the FLIP, I went through this FLIP quickly and found some issues which I think we 
need to deep discuss later. As we’re on a short Dragon boat Festival,  could you kindly hold 
on this thread? and we will back to continue the FLIP discuss.

Best,
Leonard 


> 2025 4月 29 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> 
> Hi all,
> 
> I would like to open up for discussion a new FLIP-529 [1].
> 
> Motivation:
> Currently, Flink SQL handles external connectivity by defining endpoints
> and credentials in table configuration. This approach prevents reusability
> of these connections and makes table definition less secure by exposing
> sensitive information.
> We propose the introduction of a new "connection" resource in Flink. This
> will be a pluggable resource configured with a remote endpoint and
> associated access key. Once defined, connections can be reused across table
> definitions, and eventually for model definition (as discussed in FLIP-437)
> for inference, enabling seamless and secure integration with external
> systems.
> The connection resource will provide a new, optional way to manage external
> connectivity in Flink. Existing methods for table definitions will remain
> unchanged.
> 
> [1] https://cwiki.apache.org/confluence/x/cYroF
> 
> Best Regards,
> Mayank Juneja


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hongshun Wang <lo...@gmail.com>.
Hi Hao,
> System connection is
not bound to catalog and can be used to create catalog.

It looks good to me.

Best,
Hongshun

> 2025年8月7日 00:05,Hao Li <hl...@confluent.io.INVALID> 写道:
> 
> System connection is
> not bound to catalog and can be used to create catalog.


Re: [DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hao Li <hl...@confluent.io.INVALID>.
Hi Hongshun,

Thanks for your question. Answer your question below:

> Does this mean that users are still required to provide initial
credentials (e.g., username and password) when creating the catalog?

There are two types of connection: system and catalog. System connection is
not bound to catalog and can be used to create catalog. But in the FLIP, we
only proposed temporary system connection which is in memory. I updated the
FLIP to reflect it.

> On the other hand, if a table is created using a catalog that already has
an associated connection, it seems no additional connection properties need
to be specified — which is great. But then, why do we need per-connection
credentials at all? Could the catalog-level connection be sufficient in
most cases?

I think the credential for tables in the catalog may not be the same as the
catalog credential itself. For example, kafka table credentials is not
likely to be the credential you use to connect to your catalog. There are
also models/functions in catalog which can also have other credentials.

Thanks,
Hao

On Tue, Aug 5, 2025 at 7:54 PM Hongshun Wang <lo...@gmail.com>
wrote:

> Hi Mayank,
> Sorry for joining this FLIP discussion late. I can see that it
> significantly reduces complexity and improves security when creating tables.
>
> However, I have a question regarding its usage in the context of catalogs:
>
> In the current FLIP, when creating a connection within a catalog, we use:
> CREATE [TEMPORARY] [SYSTEM] CONNECTION [IF NOT EXISTS]
> [catalog_name.][db_name.]connection_name
> [COMMENT connection_comment]
> WITH (
>     'type' = 'basic' | 'bearer' | 'oauth' | 'custom_type',
>     'url' = 'endpoint_url',
>     'username' = 'user_name',     -- Will be extracted to SecretStore
>     'password' = 'user_password', -- Will be extracted to SecretStore
>     ...
> )
>
> But we still need to define the catalog itself with some connection
> information upfront. Does this mean that users are still required to
> provide initial credentials (e.g., username and password) when creating the
> catalog?
>
> If so, isn't this inconsistent with the goal of centralizing and securing
> credentials via the SecretStore?
>
>
> On the other hand, if a table is created using a catalog that already has
> an associated connection, it seems no additional connection properties need
> to be specified — which is great. But then, why do we need per-connection
> credentials at all? Could the catalog-level connection be sufficient in
> most cases?
>
>
> Best
> Hongshun
>
> > 2025年4月29日 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> >
> > Hi all,
> >
> > I would like to open up for discussion a new FLIP-529 [1].
> >
> > Motivation:
> > Currently, Flink SQL handles external connectivity by defining endpoints
> > and credentials in table configuration. This approach prevents
> reusability
> > of these connections and makes table definition less secure by exposing
> > sensitive information.
> > We propose the introduction of a new "connection" resource in Flink. This
> > will be a pluggable resource configured with a remote endpoint and
> > associated access key. Once defined, connections can be reused across
> table
> > definitions, and eventually for model definition (as discussed in
> FLIP-437)
> > for inference, enabling seamless and secure integration with external
> > systems.
> > The connection resource will provide a new, optional way to manage
> external
> > connectivity in Flink. Existing methods for table definitions will remain
> > unchanged.
> >
> > [1] https://cwiki.apache.org/confluence/x/cYroF
> >
> > Best Regards,
> > Mayank Juneja
>
>

[DISCUSS] FLIP-529 Connections in Flink SQL and Table API

Posted by Hongshun Wang <lo...@gmail.com>.
Hi Mayank,
Sorry for joining this FLIP discussion late. I can see that it significantly reduces complexity and improves security when creating tables.

However, I have a question regarding its usage in the context of catalogs:

In the current FLIP, when creating a connection within a catalog, we use:
CREATE [TEMPORARY] [SYSTEM] CONNECTION [IF NOT EXISTS] [catalog_name.][db_name.]connection_name
[COMMENT connection_comment]
WITH (
    'type' = 'basic' | 'bearer' | 'oauth' | 'custom_type',
    'url' = 'endpoint_url',
    'username' = 'user_name',     -- Will be extracted to SecretStore
    'password' = 'user_password', -- Will be extracted to SecretStore
    ...
)

But we still need to define the catalog itself with some connection information upfront. Does this mean that users are still required to provide initial credentials (e.g., username and password) when creating the catalog?

If so, isn't this inconsistent with the goal of centralizing and securing credentials via the SecretStore?


On the other hand, if a table is created using a catalog that already has an associated connection, it seems no additional connection properties need to be specified — which is great. But then, why do we need per-connection credentials at all? Could the catalog-level connection be sufficient in most cases?


Best
Hongshun

> 2025年4月29日 23:07,Mayank Juneja <ma...@gmail.com> 写道:
> 
> Hi all,
> 
> I would like to open up for discussion a new FLIP-529 [1].
> 
> Motivation:
> Currently, Flink SQL handles external connectivity by defining endpoints
> and credentials in table configuration. This approach prevents reusability
> of these connections and makes table definition less secure by exposing
> sensitive information.
> We propose the introduction of a new "connection" resource in Flink. This
> will be a pluggable resource configured with a remote endpoint and
> associated access key. Once defined, connections can be reused across table
> definitions, and eventually for model definition (as discussed in FLIP-437)
> for inference, enabling seamless and secure integration with external
> systems.
> The connection resource will provide a new, optional way to manage external
> connectivity in Flink. Existing methods for table definitions will remain
> unchanged.
> 
> [1] https://cwiki.apache.org/confluence/x/cYroF
> 
> Best Regards,
> Mayank Juneja