Source:
private static TableEnvironment prepareTableEnv(String sourceTablePath, Boolean useTableStats) { EnvironmentSettings environmentSettings = EnvironmentSettings .newInstance() .useBlinkPlanner() .inBatchMode() .build(); TableEnvironment tEnv = TableEnvironment.create(environmentSettings); tEnv.getConfig().getConfiguration().setString( ExecutionConfigOptions.TABLE_EXEC_SHUFFLE_MODE, GlobalDataExchangeMode.ALL_EDGES_BLOCKING.toString()); tEnv.getConfig().getConfiguration() .setInteger(ExecutionConfigOptions.TABLE_EXEC_RESOURCE_DEFAULT_PARALLELISM, 4); tEnv.getConfig().getConfiguration() .setLong(OptimizerConfigOptions.TABLE_OPTIMIZER_BROADCAST_JOIN_THRESHOLD, 10 * 1024 * 1024); tEnv.getConfig().getConfiguration() .setBoolean(OptimizerConfigOptions.TABLE_OPTIMIZER_JOIN_REORDER_ENABLED, true); TCPDS_TABLES.forEach(table -> { TpcdsSchema schema = TpcdsSchemaProvider.getTableSchema(table); CsvTableSource.Builder builder = CsvTableSource.builder(); builder.path(sourceTablePath + FILE_SEPARATOR + table + DATA_SUFFIX); for (int i = 0; i < schema.getFieldNames().size(); i++) { builder.field( schema.getFieldNames().get(i), TypeConversions.fromDataTypeToLegacyInfo(schema.getFieldTypes().get(i))); } builder.fieldDelimiter(COL_DELIMITER); builder.emptyColumnAsNull(); builder.lineDelimiter("\n"); CsvTableSource tableSource = builder.build(); ConnectorCatalogTable catalogTable = ConnectorCatalogTable.source(tableSource, true); tEnv.getCatalog(tEnv.getCurrentCatalog()).ifPresent(catalog -> { try { catalog.createTable(new ObjectPath(tEnv.getCurrentDatabase(), table), catalogTable, false); } catch (Exception e) { throw new RuntimeException(e); } }); }); if (useTableStats) { TpcdsStatsProvider.registerTpcdsStats(tEnv); } return tEnv; }

Target:
private static TableEnvironment prepareTableEnv(String sourceTablePath, Boolean useTableStats) { EnvironmentSettings environmentSettings = EnvironmentSettings .newInstance() .useBlinkPlanner() .inBatchMode() .build(); TableEnvironment tEnv = TableEnvironment.create(environmentSettings); tEnv.getConfig().getConfiguration() .setInteger(ExecutionConfigOptions.TABLE_EXEC_RESOURCE_DEFAULT_PARALLELISM, 4); tEnv.getConfig().getConfiguration() .setLong(OptimizerConfigOptions.TABLE_OPTIMIZER_BROADCAST_JOIN_THRESHOLD, 10 * 1024 * 1024); tEnv.getConfig().getConfiguration() .setBoolean(OptimizerConfigOptions.TABLE_OPTIMIZER_JOIN_REORDER_ENABLED, true); TPCDS_TABLES.forEach(table -> { TpcdsSchema schema = TpcdsSchemaProvider.getTableSchema(table); CsvTableSource.Builder builder = CsvTableSource.builder(); builder.path(sourceTablePath + FILE_SEPARATOR + table + DATA_SUFFIX); for (int i = 0; i < schema.getFieldNames().size(); i++) { builder.field( schema.getFieldNames().get(i), TypeConversions.fromDataTypeToLegacyInfo(schema.getFieldTypes().get(i))); } builder.fieldDelimiter(COL_DELIMITER); builder.emptyColumnAsNull(); builder.lineDelimiter("\n"); CsvTableSource tableSource = builder.build(); ConnectorCatalogTable catalogTable = ConnectorCatalogTable.source(tableSource, true); tEnv.getCatalog(tEnv.getCurrentCatalog()).ifPresent(catalog -> { try { catalog.createTable(new ObjectPath(tEnv.getCurrentDatabase(), table), catalogTable, false); } catch (Exception e) { throw new RuntimeException(e); } }); }); if (useTableStats) { TpcdsStatsProvider.registerTpcdsStats(tEnv); } return tEnv; }