[ https://issues.apache.org/jira/browse/FLINK-4180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15391202#comment-15391202 ]
ASF GitHub Bot commented on FLINK-4180: --------------------------------------- Github user nssalian commented on a diff in the pull request: https://github.com/apache/flink/pull/2274#discussion_r71998367 --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/examples/java/JavaSQLExample.java --- @@ -0,0 +1,70 @@ +/* + * 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.examples.java; + +import org.apache.flink.api.table.Table; +import org.apache.flink.api.java.DataSet; +import org.apache.flink.api.java.ExecutionEnvironment; +import org.apache.flink.api.java.table.BatchTableEnvironment; +import org.apache.flink.api.table.TableEnvironment; + +/** + * Simple example that shows how the Batch SQL used in Java. + */ +public class JavaSQLExample { + + public static class WC { + public String word; + public long frequency; + + // Public constructor to make it a Flink POJO + public WC() { + + } + + public WC(String word, long frequency) { + this.word = word; + this.frequency = frequency; + } + + @Override + public String toString() { + return "WC " + word + " " + frequency; + } + } + + public static void main(String[] args) throws Exception { + ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); --- End diff -- Would suggest to the same comment as in WordCountSQL.scala: // set up execution environment > Create a batch SQL example > -------------------------- > > Key: FLINK-4180 > URL: https://issues.apache.org/jira/browse/FLINK-4180 > Project: Flink > Issue Type: New Feature > Components: Table API & SQL > Reporter: Timo Walther > Assignee: Jark Wu > Labels: starter > > Currently there is no runnable code example in `flink-table` showing a > working batch SQL query with the Table API. > A Scala and Java example should be added. -- This message was sent by Atlassian JIRA (v6.3.4#6332)