flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] fhueske commented on a change in pull request #6805: [FLINK-10156][table] Deprecate Table.writeToSink()
Date Thu, 11 Oct 2018 08:57:01 GMT
fhueske commented on a change in pull request #6805: [FLINK-10156][table] Deprecate Table.writeToSink()
URL: https://github.com/apache/flink/pull/6805#discussion_r224367981
 
 

 ##########
 File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala
 ##########
 @@ -944,7 +956,12 @@ class Table(
     * @param tableName Name of the registered [[TableSink]] to which the [[Table]] is written.
     */
   def insertInto(tableName: String): Unit = {
-    tableEnv.insertInto(this, tableName, this.tableEnv.queryConfig)
+    this.logicalPlan match {
+      case _: LogicalTableFunctionCall =>
+        throw new ValidationException("TableFunction can only be used in join and leftOuterJoin.")
+      case _ =>
+        tableEnv.insertInto(this, tableName, this.tableEnv.queryConfig)
 
 Review comment:
   This doesn't work because `this.tableEnv` is null if the Table was generated from a `TableFunctionCall`.

   So we cannot call `insertInto(tableName, this.tableEnv.queryConfig)` because it throws
an NPE.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message