Github user twalthr commented on a diff in the pull request: https://github.com/apache/flink/pull/1559#discussion_r51241130 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/java/table/JavaBatchTranslator.scala --- @@ -41,21 +44,13 @@ class JavaBatchTranslator extends PlanTranslator { // create table representation from DataSet val dataSetTable = new DataSetTable[A]( - repr.asInstanceOf[JavaDataSet[A]], - fieldNames + repr.asInstanceOf[JavaDataSet[A]], + fieldNames ) - - // register table in Cascading schema - val schema = Frameworks.createRootSchema(true) val tableName = repr.hashCode().toString - schema.add(tableName, dataSetTable) - // initialize RelBuilder - val frameworkConfig = Frameworks - .newConfigBuilder - .defaultSchema(schema) - .build - val relBuilder = RelBuilder.create(frameworkConfig) + TranslationContext.addDataSet(tableName, dataSetTable) --- End diff -- Do we really want to have this static? What happens if we use multipleTableEnvironments in our program? They shouldn't influence each other. Is the hash code really unique? In the old Table API we had a AtomicCounter that guaranted uniqueness.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---