[ 
https://issues.apache.org/jira/browse/FLINK-18158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17127964#comment-17127964
 ] 

Timo Walther commented on FLINK-18158:
--------------------------------------

[~jark] I think we should distinguish between 2 types of schema inferences. One 
is deriving the schema from the data (best effort maybe not accurate) and the 
other one is deriving the schema from a other strongly-typed format (e.g. Avro 
or Protobuf).

So this example:
{code}
CREATE TABLE avro WITH (format=avro, avro.schema='...')
{code}

Rather belongs to the latter kind of schema inference. This is not very SQL 
compliant. I would rather investigate how we can come up with a good type DDL. 
For automatic structured types, we should have something like {{CREATE TYPE t 
AS 'my.pojo.Class'}}. We could further extend this to {{CREATE TYPE t WITH 
(type=avro, ...)}}. Then SQL users can use this type both as a table or within 
a column:

{code}
CREATE TABLE x OF t WITH (...)
CREATE TABLE x (user t, other_user t) WITH (...)
{code}

> 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)

Reply via email to