[
https://issues.apache.org/jira/browse/FLINK-17361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17098893#comment-17098893
]
Flavio Pompermaier commented on FLINK-17361:
--------------------------------------------
[~jark] or [~Leonard Xu]: is there a way to automatically infer the column info
from the query? It could be quite annoying for the users to specify all the
column fields names and types.
I was going to introduce a new 'scan.query' property for this ticket, then I
faced another problem : how can I set 'connector.table'?
In a statement like the following, is there a way to set 'connector.table' to
the user table name (i.e. MyUserTable)? Or do I have to autogenerate an Id
somehow?
{code:sql}
CREATE TABLE MyUserTable (
...
) WITH (
'connector.type' = 'jdbc',
'connector.url' = 'jdbc:mysql://localhost:3306/flink-test',
'scan.query' = 'select x.a, y.b FROM X JOIN Y ON X.k = Y.k',
{code}
> Support creating of a JDBC table using a custom query
> -----------------------------------------------------
>
> Key: FLINK-17361
> URL: https://issues.apache.org/jira/browse/FLINK-17361
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Reporter: Flavio Pompermaier
> Priority: Major
>
> In a long discussion on the mailing list it has emerged how it is not
> possible to create a JDBC table that extract data using a custom query.
> A temporary workaround could be to assign as 'connector.table' the target
> query.
> However this is undesirable.
> Moreover, in relation to https://issues.apache.org/jira/browse/FLINK-17360, a
> query could be actually a statement that requires parameters to be filled by
> the custom parameter values provider
--
This message was sent by Atlassian Jira
(v8.3.4#803005)