Ashfaqbs commented on code in PR #26789:
URL: https://github.com/apache/flink/pull/26789#discussion_r2208030938
##########
docs/content/docs/dev/table/sql/examples/kafka-to-kafka/kafka-to-kafka.md:
##########
@@ -0,0 +1,106 @@
+This example demonstrates how to use **Apache Flink SQL** to consume JSON
messages from a Kafka topic, process the data by transforming and filtering it,
and then produce the output to another Kafka topic.
+
+## Set Up Kafka Topics
+
+```bash
+# Create input topic
+docker exec -it docker-kafka-1 kafka-topics.sh \
+ --create --topic i-topic \
+ --bootstrap-server localhost:9092 \
+ --partitions 1 --replication-factor 1
+
+# Create output topic
+docker exec -it docker-kafka-1 kafka-topics.sh \
+ --create --topic o-topic \
+ --bootstrap-server localhost:9092 \
+ --partitions 1 --replication-factor 1
+````
+
+## Producer Script
+
+Run the following Python script to send JSON messages to the `i-topic`.
+
+```bash
+C:\tmp\flink-sql\kafka-scripts>python producer.py
+```
+
+Sample output:
+
+```
+Sending: {'name': 'Sheila Grant', 'email': '[email protected]', 'role':
'developer'}
+Sending: {'name': 'Crystal Osborne', 'email': '[email protected]', 'role':
'architect'}
+...
+✅ All messages sent.
+```
+
+## Define Flink SQL Tables
+
+In Flink SQL CLI:
+
+```sql
+-- Input Table
+CREATE TABLE kafka_input (
+ name STRING,
+ email STRING,
+ role STRING
+) WITH (
+ 'connector' = 'kafka',
+ 'topic' = 'i-topic',
+ 'properties.bootstrap.servers' = 'kafka:9093',
+ 'properties.group.id' = 'flink-i-consumer',
+ 'scan.startup.mode' = 'earliest-offset',
+ 'format' = 'json',
+ 'json.ignore-parse-errors' = 'true'
+);
+
+-- Output Table
+CREATE TABLE kafka_output (
+ name STRING,
+ email STRING,
+ role STRING
+) WITH (
+ 'connector' = 'kafka',
+ 'topic' = 'o-topic',
+ 'properties.bootstrap.servers' = 'kafka:9093',
+ 'format' = 'json'
+);
+```
+
+## Submit SQL Job
Review Comment:
Acknowledged. I’ve annotated the SQL query and also highlighted it in the
summary section for clarity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]