Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3829#discussion_r139529681
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala
---
@@ -762,13 +763,10 @@ class Table(
* @tparam T The data type that the [[TableSink]] expects.
*/
def writeToSink[T](sink: TableSink[T]): Unit = {
-
- def queryConfig = this.tableEnv match {
- case s: StreamTableEnvironment => s.queryConfig
- case b: BatchTableEnvironment => new BatchQueryConfig
- case _ => null
+ val queryConfig = Option(this.tableEnv) match {
--- End diff --
`tableEnv` should never be `null`. Can we make this `def queryConfig =
this.tableEnv.queryConfig`?
---