Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-19 Thread Timo Walther
NK/FLIP-303%3A+Support+REPLACE+TABLE+AS+SELECT+statement Best regards, Yuxia - 原始邮件 - 发件人: "Timo Walther" 收件人: "dev" 发送时间: 星期三, 2024年 6 月 12日 下午 10:19:14 主题: Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement I just noticed the CREATE TABLE

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-18 Thread Sergio Pena
Looking forward for this feature. >> > > > >> > > > Regards, >> > > > Jeyhun >> > > > >> > > > On Thu, Jun 13, 2024 at 4:48 PM Sergio Pena >> > > > > > >> > > > wrote: >> > > > >&g

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-18 Thread Sergio Pena
> > > > > wrote: > > > > > > > > > Sure Yuxia, I just added the support for RTAS statements too. > > > > > > > > > > - Sergio > > > > > > > > > > On Wed, Jun 12, 2024 at 8:22 PM yuxia > > &

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-17 Thread Ron Liu
> > > > > > Hi, Sergio. > > > > > Thanks for driving the FLIP. Given we also has REPLACE TABLE AS > > > > > Statement[1] and it's almost same with CREATE TABLE AS Statement, > > > > > would you mind also support

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-17 Thread Sergio Pena
> Statement > > > > to CREATE TABLE AS Statement > > > > > > > > > > > > [1] > > > > > > > > > > https://cwiki.apache.org/confluence/display/FLINK/FLIP-303%3A+Support+REPLACE+TABLE+AS+SELECT+statement >

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-16 Thread Ron Liu
; > > > > [1] > > > > > > https://cwiki.apache.org/confluence/display/FLINK/FLIP-303%3A+Support+REPLACE+TABLE+AS+SELECT+statement > > > > > > Best regards, > > > Yuxia > > > > > > - 原始邮件 - > > > 发件人: "

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-13 Thread Jeyhun Karimov
> Yuxia > > > > ----- 原始邮件 ----- > > 发件人: "Timo Walther" > > 收件人: "dev" > > 发送时间: 星期三, 2024年 6 月 12日 下午 10:19:14 > > 主题: Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS > Statement > > > > > I just noticed t

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-13 Thread Sergio Pena
LECT+statement > > Best regards, > Yuxia > > - 原始邮件 - > 发件人: "Timo Walther" > 收件人: "dev" > 发送时间: 星期三, 2024年 6 月 12日 下午 10:19:14 > 主题: Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement > > > I just noticed the CREATE T

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-12 Thread yuxia
atement to CREATE TABLE AS Statement [1] https://cwiki.apache.org/confluence/display/FLINK/FLIP-303%3A+Support+REPLACE+TABLE+AS+SELECT+statement Best regards, Yuxia - 原始邮件 - 发件人: "Timo Walther" 收件人: "dev" 发送时间: 星期三, 2024年 6 月 12日 下午 10:19:14 主题: Re: [DISCUSS] FLIP-46

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-12 Thread Timo Walther
> I just noticed the CREATE TABLE LIKE statement allows the definition > of new columns in the CREATE part. The difference > with this CTAS proposal is that TABLE LIKE appends the new columns at > the end of the schema instead of adding them > at the beginning like this proposal and Mysql do. Thi

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-12 Thread Sergio Pena
Hey Yanquan, I just added the WITH clause to the CTAS syntax in the flip. > If we have a source table with primary keys and partition keys defined, > what is the default behavior if PARTITIONED and DISTRIBUTED not specified > in the CTAS statement, It should not be inherited by default? You're ri

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-11 Thread Yanquan Lv
Hi Sergio, thanks for driving it, +1 for this. I have some comments: 1. If we have a source table with primary keys and partition keys defined, what is the default behavior if PARTITIONED and DISTRIBUTED not specified in the CTAS statement, It should not be inherited by default? 2. I suggest provi

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-11 Thread Sergio Pena
I just noticed the CREATE TABLE LIKE statement allows the definition of new columns in the CREATE part. The difference with this CTAS proposal is that TABLE LIKE appends the new columns at the end of the schema instead of adding them at the beginning like this proposal and Mysql do. > create table

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-11 Thread Sergio Pena
Thanks Timo for answering Jeyhun questions. To add info more about your questions Jeyhun. This proposal is not handling NULL/NOT_NULL types. I noticed that the current CTAS impl. (as Timo said) adds this constraint as part of the resulting schema. And when defining a primary key in the CREATE part

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-10 Thread Timo Walther
Hi Sergio, thanks for proposing this FLIP for finalizing the CTAS statement. Adopting the logic from MySQL for deriving and potentially overwriting parts of the schema should be easy to understand for everyone. So +1 for the FLIP in general. > How do you handle CTAS statements with SELECT cl

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-10 Thread Jeyhun Karimov
Hi Sergio, Thanks for driving this FLIP. +1 for it. I have a few questions: - How do you handle CTAS statements with SELECT clauses that have (implicit or explicit) NULLABLE or NOT NULLABLE columns? Could you also mention the casting rules in the FLIP for this case? - In some cases, redefining th

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-10 Thread Sergio Pena
Hi David, The CTAS feature is already part of Flink (proposed in FLIP-218 [1]). The new FLIP-463 is just to extend the CTAS syntax to allow for adding new columns to the created table that are not part of the generated schema. I think FLIP-218 [1] was discussed in the mail list somewhere, but I co

Re: [DISCUSS] FLIP-463: Schema Definition in CREATE TABLE AS Statement

2024-06-10 Thread David Radley
Hi Sergio, Sounds good . I am relatively new to this area and had some basic questions: I notice in [1] it talks of materialized views. And CREATE view can already take the AS keyword. It would be useful to me to understand when we would use each of these. - I assume the table will be kept up t