Flink SQL: Execute DELETE queries

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Flink SQL: Execute DELETE queries

Papadopoulos, Konstantinos

Hi all,

 

I experiment on Flink Table API & SQL and I have the following question; is there any way to execute DELETE queries using Flink SQL?

 

Thanks in advance,

Konstantinos

Reply | Threaded
Open this post in threaded view
|

RE: Flink SQL: Execute DELETE queries

Vasyl Bervetskyi

Hi Papadopoulos,

 

Unfortunately no, there is no DELETE or MODIFY queries, you should create new table as a result of query which will filter records from existing one  

 

From: Papadopoulos, Konstantinos <[hidden email]>
Sent: Tuesday, May 28, 2019 5:25 PM
To: [hidden email]
Subject: Flink SQL: Execute DELETE queries

 

Hi all,

 

I experiment on Flink Table API & SQL and I have the following question; is there any way to execute DELETE queries using Flink SQL?

 

Thanks in advance,

Konstantinos

Reply | Threaded
Open this post in threaded view
|

RE: Flink SQL: Execute DELETE queries

Papadopoulos, Konstantinos

The case I have in mind was to have an external JDBC table sink and try to delete a number of or all rows of the target DB table. Is it possible using Flink SQL?

 

From: Vasyl Bervetskyi <[hidden email]>
Sent: Tuesday, May 28, 2019 5:36 PM
To: Papadopoulos, Konstantinos <[hidden email]>
Cc: [hidden email]
Subject: RE: Flink SQL: Execute DELETE queries

 

Hi Papadopoulos,

 

Unfortunately no, there is no DELETE or MODIFY queries, you should create new table as a result of query which will filter records from existing one  

 

From: Papadopoulos, Konstantinos <[hidden email]>
Sent: Tuesday, May 28, 2019 5:25 PM
To: [hidden email]
Subject: Flink SQL: Execute DELETE queries

 

Hi all,

 

I experiment on Flink Table API & SQL and I have the following question; is there any way to execute DELETE queries using Flink SQL?

 

Thanks in advance,

Konstantinos

Reply | Threaded
Open this post in threaded view
|

Re: Flink SQL: Execute DELETE queries

JingsongLee
Hi @Papadopoulos, Konstantinos
I think you can try something like this:
JDBCAppendTableSink sink = JDBCAppendTableSink.builder()
.setDrivername("foo")
.setDBUrl("bar")
.setQuery("delete from %s where id = ?)")
.setParameterTypes(FIELD_TYPES)
.build();
Or you can build your own Sink code, where you can delete rows of DB table.

Best, JingsongLee

------------------------------------------------------------------
From:Papadopoulos, Konstantinos <[hidden email]>
Send Time:2019年5月28日(星期二) 22:54
To:Vasyl Bervetskyi <[hidden email]>
Subject:RE: Flink SQL: Execute DELETE queries

The case I have in mind was to have an external JDBC table sink and try to delete a number of or all rows of the target DB table. Is it possible using Flink SQL?

 

From: Vasyl Bervetskyi <[hidden email]>
Sent: Tuesday, May 28, 2019 5:36 PM
To: Papadopoulos, Konstantinos <[hidden email]>
Cc: [hidden email]
Subject: RE: Flink SQL: Execute DELETE queries

 

Hi Papadopoulos,

 

Unfortunately no, there is no DELETE or MODIFY queries, you should create new table as a result of query which will filter records from existing one  

 

From: Papadopoulos, Konstantinos <[hidden email]>
Sent: Tuesday, May 28, 2019 5:25 PM
To: [hidden email]
Subject: Flink SQL: Execute DELETE queries

 

Hi all,

 

I experiment on Flink Table API & SQL and I have the following question; is there any way to execute DELETE queries using Flink SQL?

 

Thanks in advance,

Konstantinos