Lorenzo Affetti created FLINK-34509:
---------------------------------------

             Summary: Docs: Fix Debezium JSON/AVRO opts in examples 
                 Key: FLINK-34509
                 URL: https://issues.apache.org/jira/browse/FLINK-34509
             Project: Flink
          Issue Type: Improvement
          Components: Documentation
            Reporter: Lorenzo Affetti


Problem found here: 
[https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/table/formats/debezium/#how-to-use-debezium-format.]

Here is the example provided:
{code:java}
CREATE TABLE topic_products (
  -- schema is totally the same to the MySQL "products" table
  id BIGINT,
  name STRING,
  description STRING,
  weight DECIMAL(10, 2)
) WITH (
 'connector' = 'kafka',
 'topic' = 'products_binlog',
 'properties.bootstrap.servers' = 'localhost:9092',
 'properties.group.id' = 'testGroup',
 -- using 'debezium-json' as the format to interpret Debezium JSON messages
 -- please use 'debezium-avro-confluent' if Debezium encodes messages in Avro 
format
 'format' = 'debezium-json'
) {code}
Actually, `debezium-json` would require `'debezium-json.schema-include' = 
'true'` to work (as, by default, Debezium includes the schema. See 
[https://www.markhneedham.com/blog/2023/01/24/flink-sql-could-not-execute-sql-statement-corrupt-debezium-message/).]

On the other hand `debezium-avro` would require the URL of the Confluent schema 
registry: `'debezium-avro-confluent.url' = '[http://...:8081'.]

I propose to split the single example in 2 with the correct default options.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to