Hi, I'm a newbie to Flink. I'm trying to load data from HDFS and analyze it using Flink Table APIs.
I created a TableSource, and registered it into the StreamTableEnvironment as a table, and ran a SQL on that table through streamTableEnvironment.sqlQuery, and finally I called writeToSink to write the result to a Kafka010JsonTableSink. But, I got an exception, "Exception in thread "main" org.apache.flink.table.api.TableException: AppendStreamTableSink requires that Table has only insert changes." I've googled it. The probable cause is that I put a "group by" clause in the SQL statement, which makes the result table to be a retract table. And, if I pass a SQL statement without "group by" clause to sqlQuery, everything gets ok, and I can see the result in the Kafka topic. So, my questions are: 1. What is the classical usage for outputing a retract table? 2. Is there a unified way to process output for both append-only and not append-only table? Thanks. Best Regards~