JDBC table api questions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JDBC table api questions

Flavio Pompermaier
Hi all,
is there a way to get the list of existing views in a JDBC database?
Is this something that could be supported somehow?

Moreover, it would be interesting for us to also know the original field type of a table..is there a way to get it (without implementing a dedicated API)? Do you think it makes sense to expose it in the Table API?

Best,
Flavio
Reply | Threaded
Open this post in threaded view
|

Re: JDBC table api questions

Zhenghua Gao
FLINK-16471 introduce a JDBCCatalog, which implements Catalog interface.
Currently we only support PostgresCatalog and listTables(). 
If you want to get the list of views, you can implement listViews() (currently return an empty list).

Best Regards,
Zhenghua Gao


On Thu, Apr 23, 2020 at 8:48 PM Flavio Pompermaier <[hidden email]> wrote:
Hi all,
is there a way to get the list of existing views in a JDBC database?
Is this something that could be supported somehow?

Moreover, it would be interesting for us to also know the original field type of a table..is there a way to get it (without implementing a dedicated API)? Do you think it makes sense to expose it in the Table API?

Best,
Flavio
Reply | Threaded
Open this post in threaded view
|

Re: JDBC table api questions

Flavio Pompermaier
Ok, but how can view then retrieved via table API? If they are returned as Table objects, is there a way to mark them read only?
Because VIEWS in Flink SQL are Flink Views, so how can I query JDBC views?

On Fri, Apr 24, 2020 at 4:22 AM Zhenghua Gao <[hidden email]> wrote:
FLINK-16471 introduce a JDBCCatalog, which implements Catalog interface.
Currently we only support PostgresCatalog and listTables(). 
If you want to get the list of views, you can implement listViews() (currently return an empty list).

Best Regards,
Zhenghua Gao


On Thu, Apr 23, 2020 at 8:48 PM Flavio Pompermaier <[hidden email]> wrote:
Hi all,
is there a way to get the list of existing views in a JDBC database?
Is this something that could be supported somehow?

Moreover, it would be interesting for us to also know the original field type of a table..is there a way to get it (without implementing a dedicated API)? Do you think it makes sense to expose it in the Table API?

Best,
Flavio


Reply | Threaded
Open this post in threaded view
|

Re: JDBC table api questions

Jark Wu-3
Hi,

I think views in a JDBC database is not the same thing of views in Flink Catalog, but something like a read-only table as Flavio said. 
Maybe we can provide a way to register a table only as a source even the connector factory supports both source and sink. 

cc [hidden email] , do you have some thoughts on this?

Best,
Jark




On Fri, 24 Apr 2020 at 15:13, Flavio Pompermaier <[hidden email]> wrote:
Ok, but how can view then retrieved via table API? If they are returned as Table objects, is there a way to mark them read only?
Because VIEWS in Flink SQL are Flink Views, so how can I query JDBC views?

On Fri, Apr 24, 2020 at 4:22 AM Zhenghua Gao <[hidden email]> wrote:
FLINK-16471 introduce a JDBCCatalog, which implements Catalog interface.
Currently we only support PostgresCatalog and listTables(). 
If you want to get the list of views, you can implement listViews() (currently return an empty list).

Best Regards,
Zhenghua Gao


On Thu, Apr 23, 2020 at 8:48 PM Flavio Pompermaier <[hidden email]> wrote:
Hi all,
is there a way to get the list of existing views in a JDBC database?
Is this something that could be supported somehow?

Moreover, it would be interesting for us to also know the original field type of a table..is there a way to get it (without implementing a dedicated API)? Do you think it makes sense to expose it in the Table API?

Best,
Flavio