You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/09 04:32:28 UTC

[GitHub] [flink] godfreyhe opened a new pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

godfreyhe opened a new pull request #12049:
URL: https://github.com/apache/flink/pull/12049


   
   ## What is the purpose of the change
   
   *This pr aims to let TableEnvironment#executeSql support SELECT statement and introduce Table#execute api. Current BatchSelectTableSink and StreamSelectTableSink is temporary solution, this will be solved in [FLINK-14807](https://issues.apache.org/jira/browse/FLINK-14807). StreamSelectTableSink only support insert changes, after [FLINK-16998](https://issues.apache.org/jira/browse/FLINK-16998) is finished, all kinds of changes will be supported.*
   
   
   ## Brief change log
   
     - *TableEnvironment#executeSql supports SELECT statement*
     - *Introduce Table#execute api*
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
     - *Extended TableEnvironmentITCase to verify SELECT statement*
     - *Added TableITCase that validates Table#collect method*
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (**yes** / no)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (**yes** / no)
     - If yes, how is the feature documented? (not applicable / docs / **JavaDocs** / not documented)
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] TsReaper commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
TsReaper commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422455370



##########
File path: flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/sinks/StreamSelectTableSink.scala
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.sinks
+
+import org.apache.flink.api.common.ExecutionConfig
+import org.apache.flink.core.execution.JobClient
+import org.apache.flink.streaming.api.datastream.{DataStream, DataStreamSink}
+import org.apache.flink.streaming.experimental.{CollectSink, SocketStreamIterator}
+import org.apache.flink.table.api.TableSchema
+import org.apache.flink.table.api.internal.SelectTableSink
+import org.apache.flink.table.types.DataType
+import org.apache.flink.types.Row
+
+import java.net.InetAddress
+import java.util
+
+/**
+  * A [[SelectTableSink]] for streaming select job.
+  *
+  * <p><strong>NOTES:</strong> This is a temporary solution,
+  * once FLINK-14807 is finished, the implementation should be changed.

Review comment:
       We'll leave the select in old planner untouched. FLINK-14807 only optimize select in blink planner.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422997187



##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/sinks/SelectTableSinkSchemaConverter.java
##########
@@ -0,0 +1,61 @@
+/*
+ * 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.planner.sinks;
+
+import org.apache.flink.table.api.DataTypes;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.runtime.types.LogicalTypeDataTypeConverter;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.TimestampKind;
+import org.apache.flink.table.types.logical.TimestampType;
+
+/**
+ * An utility class that changes to default conversion class
+ * and converts time attributes (proc time / event time) to regular timestamps.
+ */
+class SelectTableSinkSchemaConverter {
+
+	/**
+	 * Change to default conversion class and
+	 * convert time attributes (proc time / event time) to regular timestamps,
+	 * return a new {@link TableSchema}.
+	 */
+	static TableSchema convert(TableSchema tableSchema) {

Review comment:
       This `convert` is too ambiguous, you can do whatever you want in this but reader can not have a clue what you really did. I would suggest split the logics into some atomic ones each with clear semantic. BTW, I think we can create an abstract class for both batch and stream select table sink, and put these methods there. 

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/sinks/SelectTableSinkSchemaConverter.java
##########
@@ -0,0 +1,61 @@
+/*
+ * 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.planner.sinks;
+
+import org.apache.flink.table.api.DataTypes;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.runtime.types.LogicalTypeDataTypeConverter;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.table.types.logical.TimestampKind;
+import org.apache.flink.table.types.logical.TimestampType;
+
+/**
+ * An utility class that changes to default conversion class
+ * and converts time attributes (proc time / event time) to regular timestamps.
+ */
+class SelectTableSinkSchemaConverter {
+
+	/**
+	 * Change to default conversion class and
+	 * convert time attributes (proc time / event time) to regular timestamps,
+	 * return a new {@link TableSchema}.
+	 */
+	static TableSchema convert(TableSchema tableSchema) {
+		DataType[] oldTypes = tableSchema.getFieldDataTypes();
+		String[] oldNames = tableSchema.getFieldNames();
+
+		TableSchema.Builder builder = TableSchema.builder();
+		for (int i = 0; i < tableSchema.getFieldCount(); i++) {
+			// change to default conversion class
+			DataType fieldType = LogicalTypeDataTypeConverter.fromLogicalTypeToDataType(

Review comment:
       `LogicalTypeDataTypeConverter` is deprecated

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/sinks/StreamSelectTableSink.java
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.planner.sinks;
+
+import org.apache.flink.api.common.ExecutionConfig;
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.core.execution.JobClient;
+import org.apache.flink.streaming.api.datastream.DataStream;
+import org.apache.flink.streaming.api.datastream.DataStreamSink;
+import org.apache.flink.streaming.experimental.CollectSink;
+import org.apache.flink.streaming.experimental.SocketStreamIterator;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.api.internal.SelectTableSink;
+import org.apache.flink.table.runtime.types.TypeInfoDataTypeConverter;
+import org.apache.flink.table.sinks.AppendStreamTableSink;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.types.Row;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.util.Iterator;
+
+/**
+ * A {@link SelectTableSink} for streaming select job.
+ *
+ * <p><strong>NOTES:</strong> This is a temporary solution,
+ * once FLINK-14807 is finished, the implementation should be changed.
+ * Currently, only insert changes (AppendStreamTableSink) is supported.
+ * Once FLINK-16998 is finished, all kinds of changes will be supported.
+ */
+public class StreamSelectTableSink implements AppendStreamTableSink<Row>, SelectTableSink {
+	private final TableSchema tableSchema;
+	private final TypeSerializer<Row> typeSerializer;
+	private final SocketStreamIterator<Row> iterator;
+
+	@SuppressWarnings("unchecked")
+	public StreamSelectTableSink(TableSchema tableSchema) {
+		this.tableSchema = SelectTableSinkSchemaConverter.convert(tableSchema);
+		this.typeSerializer = (TypeSerializer<Row>) TypeInfoDataTypeConverter

Review comment:
       `TypeInfoDataTypeConverter ` is deprecated

##########
File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/sinks/BatchSelectTableSink.java
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.planner.sinks;
+
+import org.apache.flink.api.common.ExecutionConfig;
+import org.apache.flink.api.common.JobExecutionResult;
+import org.apache.flink.api.common.accumulators.SerializedListAccumulator;
+import org.apache.flink.api.common.typeutils.TypeSerializer;
+import org.apache.flink.api.java.Utils;
+import org.apache.flink.core.execution.JobClient;
+import org.apache.flink.streaming.api.datastream.DataStream;
+import org.apache.flink.streaming.api.datastream.DataStreamSink;
+import org.apache.flink.table.api.TableException;
+import org.apache.flink.table.api.TableSchema;
+import org.apache.flink.table.api.internal.SelectTableSink;
+import org.apache.flink.table.runtime.types.TypeInfoDataTypeConverter;
+import org.apache.flink.table.sinks.StreamTableSink;
+import org.apache.flink.table.types.DataType;
+import org.apache.flink.types.Row;
+import org.apache.flink.util.AbstractID;
+import org.apache.flink.util.Preconditions;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.ExecutionException;
+
+/**
+ * A {@link SelectTableSink} for batch select job.
+ *
+ * <p><strong>NOTES:</strong> This is a temporary solution,
+ * once FLINK-14807 is finished, the implementation should be changed.
+ */
+public class BatchSelectTableSink implements StreamTableSink<Row>, SelectTableSink {
+	private final TableSchema tableSchema;
+	private final String accumulatorName;
+	private final TypeSerializer<Row> typeSerializer;
+	private JobClient jobClient;
+
+	@SuppressWarnings("unchecked")
+	public BatchSelectTableSink(TableSchema tableSchema) {
+		this.tableSchema = SelectTableSinkSchemaConverter.convert(tableSchema);
+		this.accumulatorName = new AbstractID().toString();
+		this.typeSerializer = (TypeSerializer<Row>) TypeInfoDataTypeConverter

Review comment:
       why use this deprecated `TypeInfoDataTypeConverter`?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 81239cf3aad1f56898e631fb112db8899b8d26ea Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 51b55e2c28fedc447b10d43351ea6fc2b385eff0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 93c649a3d8dd3f1c5a6112822395acf0a9b7054f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422994564



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/delegation/Planner.java
##########
@@ -74,14 +76,22 @@
 	 */
 	List<Transformation<?>> translate(List<ModifyOperation> modifyOperations);
 
+	/**
+	 * Creates a {@link SelectTableSink} for a select query.
+	 *
+	 * @param tableSchema the table schema of select result.
+	 * @return The {@link SelectTableSink} for the select query.
+	 */
+	SelectTableSink createSelectTableSink(TableSchema tableSchema);

Review comment:
       ok, let's keep it for now and revisit this later if we have better idea.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] godfreyhe removed a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
godfreyhe removed a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626140019


   > TableUtils
   
   I plan to do some code cleanup in [FLINK-16364](https://issues.apache.org/jira/browse/FLINK-16364)


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 81239cf3aad1f56898e631fb112db8899b8d26ea Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907) 
   * f5c5ddffcf97a0a121368d6b3efa76429a47958d UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] godfreyhe commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
godfreyhe commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626590605


   @flinkbot run azure


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 93c649a3d8dd3f1c5a6112822395acf0a9b7054f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889) 
   * d0c272460163b880346d84852102b28bcd6c63a2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] godfreyhe commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
godfreyhe commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626496388


   @flinkbot run azure


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626316081


   Please do another rebase


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915",
       "triggerID" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=921",
       "triggerID" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5c5ddffcf97a0a121368d6b3efa76429a47958d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915) 
   * 50dfd19d62da7a39f2004934703344b7f3d95573 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=921) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915",
       "triggerID" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=921",
       "triggerID" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3640d760380b6b527a115e09363f596fd0134c82",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=933",
       "triggerID" : "3640d760380b6b527a115e09363f596fd0134c82",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3640d760380b6b527a115e09363f596fd0134c82 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=933) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] godfreyhe commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
godfreyhe commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422470978



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/sinks/BatchSelectTableSink.scala
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.planner.sinks

Review comment:
       I think you can do rename in FLINK-14807




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 51b55e2c28fedc447b10d43351ea6fc2b385eff0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865) 
   * 93c649a3d8dd3f1c5a6112822395acf0a9b7054f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915",
       "triggerID" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5c5ddffcf97a0a121368d6b3efa76429a47958d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422456365



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -880,12 +886,36 @@ private TableResult executeOperation(Operation operation) {
 					.data(Collections.singletonList(Row.of(explanation)))
 					.setPrintStyle(TableResultImpl.PrintStyle.RAW_CONTENT)
 					.build();
-
+		} else if (operation instanceof QueryOperation) {
+			return executeQueryOperation((QueryOperation) operation);
 		} else {
 			throw new TableException(UNSUPPORTED_QUERY_IN_EXECUTE_SQL_MSG);
 		}
 	}
 
+	private TableResult executeQueryOperation(QueryOperation operation) {

Review comment:
       we can put the implementation directly under `executeInternal(QueryOperation operation)`

##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/sinks/BatchSelectTableSink.scala
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.planner.sinks
+
+import org.apache.flink.api.common.ExecutionConfig
+import org.apache.flink.api.common.accumulators.SerializedListAccumulator
+import org.apache.flink.api.java.Utils
+import org.apache.flink.core.execution.JobClient
+import org.apache.flink.streaming.api.datastream.{DataStream, DataStreamSink}
+import org.apache.flink.table.api.internal.SelectTableSink
+import org.apache.flink.table.api.{TableException, TableSchema}
+import org.apache.flink.table.sinks.StreamTableSink
+import org.apache.flink.table.types.DataType
+import org.apache.flink.types
+import org.apache.flink.types.Row
+import org.apache.flink.util.{AbstractID, Preconditions}
+
+import java.util
+
+/**
+  * A [[SelectTableSink]] for batch select job.
+  *
+  * <p><strong>NOTES:</strong> This is a temporary solution,
+  * once FLINK-14807 is finished, the implementation should be changed.
+  */
+class BatchSelectTableSink(tableSchema: TableSchema)

Review comment:
       I think we should avoid using scala to introduce new table sinks




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422809027



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/delegation/Planner.java
##########
@@ -74,14 +76,22 @@
 	 */
 	List<Transformation<?>> translate(List<ModifyOperation> modifyOperations);
 
+	/**
+	 * Creates a {@link SelectTableSink} for a select query.
+	 *
+	 * @param tableSchema the table schema of select result.
+	 * @return The {@link SelectTableSink} for the select query.
+	 */
+	SelectTableSink createSelectTableSink(TableSchema tableSchema);

Review comment:
       This interface looks strange to me. An alternative approach is we create another dedicated `ModifyOperation` which used for collecting, and reuse the `List<Transformation<?>> translate(List<ModifyOperation> modifyOperations);`. We can encapsulate the logic under this method.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d0c272460163b880346d84852102b28bcd6c63a2 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898) 
   * 81239cf3aad1f56898e631fb112db8899b8d26ea Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d0c272460163b880346d84852102b28bcd6c63a2 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7505ae67590462ee72054867d405a342effea1c1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] godfreyhe commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
godfreyhe commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626140019


   > TableUtils
   
   I plan to do some code cleanup in [FLINK-16364](https://issues.apache.org/jira/browse/FLINK-16364)


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] godfreyhe commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
godfreyhe commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422826714



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/delegation/Planner.java
##########
@@ -74,14 +76,22 @@
 	 */
 	List<Transformation<?>> translate(List<ModifyOperation> modifyOperations);
 
+	/**
+	 * Creates a {@link SelectTableSink} for a select query.
+	 *
+	 * @param tableSchema the table schema of select result.
+	 * @return The {@link SelectTableSink} for the select query.
+	 */
+	SelectTableSink createSelectTableSink(TableSchema tableSchema);

Review comment:
       I think it does not work. because collect Iterator is generated in `TableSink` (e.g. the iterator is created when `StreamSelectTableSink` is created.) and we need to put it into `TableResult` in `TableEnvironmentImpl#executeOperation`. now we make sure that `SelectTableSink` instance is not changed after created, so we can get the correct Iterator. 
   
   while we can't get collect Iterator from the dedicated `ModifyOperation`.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626104558


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 7505ae67590462ee72054867d405a342effea1c1 (Sat May 09 04:35:48 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-17252).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915",
       "triggerID" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=921",
       "triggerID" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 50dfd19d62da7a39f2004934703344b7f3d95573 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=921) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] KurtYoung commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
KurtYoung commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626662297


   @rmetzger the bot doesn't work again, could you take a look?


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626663542


   Sorry. I manually restarted the failed job.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915",
       "triggerID" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=921",
       "triggerID" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3640d760380b6b527a115e09363f596fd0134c82",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3640d760380b6b527a115e09363f596fd0134c82",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 50dfd19d62da7a39f2004934703344b7f3d95573 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=921) 
   * 3640d760380b6b527a115e09363f596fd0134c82 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7505ae67590462ee72054867d405a342effea1c1 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7505ae67590462ee72054867d405a342effea1c1 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859) 
   * 51b55e2c28fedc447b10d43351ea6fc2b385eff0 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] godfreyhe commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
godfreyhe commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422826714



##########
File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/delegation/Planner.java
##########
@@ -74,14 +76,22 @@
 	 */
 	List<Transformation<?>> translate(List<ModifyOperation> modifyOperations);
 
+	/**
+	 * Creates a {@link SelectTableSink} for a select query.
+	 *
+	 * @param tableSchema the table schema of select result.
+	 * @return The {@link SelectTableSink} for the select query.
+	 */
+	SelectTableSink createSelectTableSink(TableSchema tableSchema);

Review comment:
       I think it does not work. because collect Iterator is generated in `TableSink` (e.g. the iterator is created when `StreamSelectTableSink` is created.) and we need to put it into `TableResult` in `TableEnvironmentImpl#executeOperation`. the `SelectTableSink` instance does not change, we can get the Iterator. 
   
   while we can't get collect Iterator from the dedicated `ModifyOperation`.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 51b55e2c28fedc447b10d43351ea6fc2b385eff0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865) 
   * 93c649a3d8dd3f1c5a6112822395acf0a9b7054f Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 93c649a3d8dd3f1c5a6112822395acf0a9b7054f Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889) 
   * d0c272460163b880346d84852102b28bcd6c63a2 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=907",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915",
       "triggerID" : "f5c5ddffcf97a0a121368d6b3efa76429a47958d",
       "triggerType" : "PUSH"
     }, {
       "hash" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "50dfd19d62da7a39f2004934703344b7f3d95573",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5c5ddffcf97a0a121368d6b3efa76429a47958d Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=915) 
   * 50dfd19d62da7a39f2004934703344b7f3d95573 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 7505ae67590462ee72054867d405a342effea1c1 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859) 
   * 51b55e2c28fedc447b10d43351ea6fc2b385eff0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626663731


   Sadly, there's a pretty long waiting queue for the E2E tests


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12049:
URL: https://github.com/apache/flink/pull/12049#issuecomment-626106371


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "7505ae67590462ee72054867d405a342effea1c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=859",
       "triggerID" : "7505ae67590462ee72054867d405a342effea1c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=865",
       "triggerID" : "51b55e2c28fedc447b10d43351ea6fc2b385eff0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=889",
       "triggerID" : "93c649a3d8dd3f1c5a6112822395acf0a9b7054f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898",
       "triggerID" : "d0c272460163b880346d84852102b28bcd6c63a2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "81239cf3aad1f56898e631fb112db8899b8d26ea",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d0c272460163b880346d84852102b28bcd6c63a2 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=898) 
   * 81239cf3aad1f56898e631fb112db8899b8d26ea UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] TsReaper commented on a change in pull request #12049: [FLINK-17252] [table] supports SELECT statement in TableEnvironment#executeSql and introduce Table#execute api

Posted by GitBox <gi...@apache.org>.
TsReaper commented on a change in pull request #12049:
URL: https://github.com/apache/flink/pull/12049#discussion_r422465811



##########
File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/sinks/BatchSelectTableSink.scala
##########
@@ -0,0 +1,78 @@
+/*
+ * 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.planner.sinks

Review comment:
       Rename the package to `org.apache.flink.table.planner.collect`? We will add iterator implementations in FLINK-14807




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org