Re: Flink-JDBC JDBCUpsertTableSink keyFields Problem

2019-11-14 Thread Jingsong Li
Hi Polarisary: Maybe I see what you mean. You want to use the upsert mode for an append stream without keyFields. In fact, both isAppend and keyFields are set automatically by the planner framework. You can't control them. So yes, it is related to sql, only upsert stream can be inserted into sink

Re: Flink-JDBC JDBCUpsertTableSink keyFields Problem

2019-11-14 Thread 张万新
A typical use case that will genreate updates (meaning not append only) is a non-widown groupy-by aggregation, like "select user, count(url) from clicks group by user". You can refer to the flink doc at https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/table/streaming/dynamic_tables.

Re: Flink-JDBC JDBCUpsertTableSink keyFields Problem

2019-11-13 Thread Polarisary
My sql is regular insert like “insert into sink_table select c1,c2,c3 from source_table”, I want to know which case it will judge to append only? Does it has doc for this? Many thanks! > 在 2019年11月14日,上午10:05,张万新 写道: > > Yes it's related to your sql, flink checks the plan of your sql to

Re: Flink-JDBC JDBCUpsertTableSink keyFields Problem

2019-11-13 Thread 张万新
Yes it's related to your sql, flink checks the plan of your sql to judge whether your job is append only or has updates. If your job is append only, that means no result need to be updated. If you still have problems, please post your sql and complete error message to help people understand your u

Flink-JDBC JDBCUpsertTableSink keyFields Problem

2019-11-13 Thread Polarisary
Hi When I use flink-jdbc JDBCUpsertTableSink for sink to mysql, the isAppendOnly is modified to ture, and keyFields is modified to null by StreamExecSink, but i want to upsert, Does this related to sql? the stack as follows: at sink.JDBCUpsertTableSink.setIsAppendOnly(JDBCUpsertTableSink.java:1