Jaehyeon Kim
02/28/2023, 2:11 AMpyflink.util.exceptions.TableException: org.apache.flink.table.api.TableException: Table sink 'default_catalog.default_database.output' doesn't support consuming update changes which is produced by node PythonGroupAggregate(groupBy=[k], select=[k, *org.apache.flink.table.functions.python.PythonAggregateFunction$82f60ecbb5d8eed484a7f66dd2ee2921*(k, v) AS TMP_0])
Below show the print sink output.
# input messages
a:a
b:hello
b:world
b:hi
# print
1> +I[a, 1, 1, a]
1> +I[b, 2, 10, hello world]
1> -U[b, 2, 10, hello world]
1> +U[b, 3, 12, hello world hi]
The script and full error messages are attached. Can you please guide me how to fix it?Dian Fu
02/28/2023, 3:04 AMappend only change logs. However, the aggregation node may produce update changes and so this is unsupported.
The following format supports accepting update changes , perhaps you could give them a try:
• debezium: https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/connectors/table/formats/debezium/
• canal: https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/connectors/table/formats/canal/
• maxwell: https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/connectors/table/formats/maxwell/
• ogg: https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/connectors/table/formats/ogg/Dian Fu
02/28/2023, 3:19 AMupsert-kafka which accepts update changes . See https://nightlies.apache.org/flink/flink-docs-release-1.16/docs/connectors/table/upsert-kafka/ for more details.Jaehyeon Kim
02/28/2023, 3:26 AMupsert-kafka.Jaehyeon Kim
02/28/2023, 4:36 AMupsert-kafka. Here is the updated output table. Note that I had to set the key field name to be longer than 1 (kk). Also raw format doesn't accept multiple columns so that I changed the value format to json. Thanks @Dian Fu !
table_env.execute_sql(
f"""
CREATE TABLE output (
kk VARCHAR,
wc BIGINT,
cc BIGINT,
w VARCHAR,
PRIMARY KEY (kk) NOT ENFORCED
) WITH (
'connector' = 'upsert-kafka',
'topic' = 'aggregations-output-topic',
'properties.bootstrap.servers' = '{BOOTSTRAP_SERVERS}',
'key.format' = 'raw',
'key.fields-prefix' = 'k',
'value.format' = 'json',
'value.json.fail-on-missing-field' = 'false',
'value.fields-include' = 'EXCEPT_KEY'
)
"""
)Raghunadh Nittala
03/08/2023, 3:19 PMJaehyeon Kim
03/08/2023, 10:36 PM