Optional fields during SQL insert

2024-01-10 Thread Gyula Fóra
Hi All! Is it possible to insert into a table without specifying all columns of the target table? In other words can we use the default / NULL values of the table when not specified somehow? For example: Query schema: [a: STRING] Sink schema: [a: STRING, b: STRING] I would like to be able to si

Re: Optional fields during SQL insert

2024-01-11 Thread Giannis Polyzos
Hi Gyula, to the best of my knowledge, this is not feasible and you will have to do something like *CAST(NULL AS STRING)* to insert null values manually. Best, Giannis On Thu, Jan 11, 2024 at 9:58 AM Gyula Fóra wrote: > Hi All! > > Is it possible to insert into a table without specifying all co

Re:Re: Optional fields during SQL insert

2024-01-11 Thread Xuyang
Hi, Gyula. If you want flink to fill the unspecified column with NULL, you can try the following sql like : ``` INSERT INTO Sink(a) SELECT a from Source ``` -- Best! Xuyang 在 2024-01-11 16:10:47,"Giannis Polyzos" 写道: Hi Gyula, to the best of my knowledge, this is not feasible a

Re: Re: Optional fields during SQL insert

2024-01-11 Thread Gyula Fóra
This worked perfectly Xuyang, nice :) Thanks! On Thu, Jan 11, 2024 at 12:52 PM Xuyang wrote: > Hi, Gyula. > If you want flink to fill the unspecified column with NULL, you can try > the following sql like : > ``` > INSERT INTO Sink(a) SELECT a from Source > ``` > > > -- > Best! > Xuyang