[
https://issues.apache.org/jira/browse/FLINK-18158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17135449#comment-17135449
]
Jark Wu commented on FLINK-18158:
---------------------------------
Hi [~twalthr], regarding to the DDL of derving schema from some meta
information. I do agree CREATE TYPE is more SQL compliant. However, it maybe
not handy for users in some cases. For examples, deriving schema from existing
relational database, e.g.
{code:sql}
CREATE TABLE mysql_table WITH (connector=jdbc,
url='jdbc:mysql://localhost:3306/test', table-name='mytable')
{code}
However, if we use CREATE TYPE DDL, we have to declare some properties multiple
times, and it's weird to declare a type for a MySQL table.
{code:sql}
CREATE TYPE mysql_table_type WITH (type=jdbc,
url='jdbc:mysql://localhost:3306/test', table-name='mytable')
CREATE TABLE mysql_table OF mysql_table_type WITH (connector=jdbc,
url='jdbc:mysql://localhost:3306/test', table-name='mytable')
{code}
>From my point of view, "SQL compliant" means we should use standard syntax as
>much as possible. But we can extend the standard if the standard doesn't solve
>our problem, just like what we did in the past (e.g. the LIKE clause,
>WATERMARK statement). I think it makes sense to extend it with omitting the
>schema part, as this is also used in many systems (e.g. KSQL, Spark SQL, Hive
>SQL).
> Add a utility to create a DDL statement from avro schema
> --------------------------------------------------------
>
> Key: FLINK-18158
> URL: https://issues.apache.org/jira/browse/FLINK-18158
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / API
> Reporter: Dawid Wysakowicz
> Priority: Major
>
> User asked if there is a way to create a TableSchema/Table originating from
> avro schema.
> https://lists.apache.org/thread.html/r9bd43449314230fad0b627a170db05284c9727371092fc275fc05b74%40%3Cuser.flink.apache.org%3E
--
This message was sent by Atlassian Jira
(v8.3.4#803005)