[ https://issues.apache.org/jira/browse/FLINK-9523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16610225#comment-16610225 ]
ASF GitHub Bot commented on FLINK-9523: --------------------------------------- twalthr commented on a change in pull request #6672: [FLINK-9523] [table] Add Kafka examples for Flink Table/SQL API URL: https://github.com/apache/flink/pull/6672#discussion_r216575925 ########## File path: flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/kafka/Kafka010JsonConsumer.java ########## @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.table.examples.java.kafka; + +import org.apache.flink.api.common.typeinfo.Types; +import org.apache.flink.api.java.utils.ParameterTool; +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; +import org.apache.flink.streaming.connectors.kafka.Kafka010JsonTableSink; +import org.apache.flink.streaming.connectors.kafka.Kafka010JsonTableSource; +import org.apache.flink.table.api.StreamTableEnvironment; +import org.apache.flink.table.api.Table; +import org.apache.flink.table.api.TableSchema; + +/** + * An example that shows how to read from and write to Kafka table rows as JSON-encoded records. + * + * <p>This example shows how to: + * - Use Kafka JSON TableSource + * - Use SQL api and a group window to compute a result + * + * <p>Example usage: + * Run Consumer with the following arguments: + * --input-topic consumer-input --output-topic consumer-output --bootstrap.servers localhost:9092 --zookeeper.connect localhost:2181 --group.id myconsumer + */ +public class Kafka010JsonConsumer { Review comment: I would call the classes `Kafka010JsonExample` to differentiate from actual consumer/producer classes. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Add Kafka examples for Flink Table/SQL API > ------------------------------------------- > > Key: FLINK-9523 > URL: https://issues.apache.org/jira/browse/FLINK-9523 > Project: Flink > Issue Type: Task > Components: Examples > Reporter: Shuyi Chen > Assignee: Mikhail Sokolov > Priority: Major > Labels: pull-request-available > > Given the popularity of Flink SQL and Kafka as streaming source, we want to > add some examples of using Kafka JSON/Avro TableSource in > flink-examples/flink-examples-table module. -- This message was sent by Atlassian JIRA (v7.6.3#76005)