use of org.apache.flink.table.api.TableConfig in project flink by apache.
the class StreamArrowPythonRowTimeBoundedRowsOperatorTest method getTestOperator.
@Override
public AbstractArrowPythonAggregateFunctionOperator getTestOperator(Configuration config, PythonFunctionInfo[] pandasAggregateFunctions, RowType inputType, RowType outputType, int[] groupingSet, int[] udafInputOffsets) {
RowType udfInputType = (RowType) Projection.of(udafInputOffsets).project(inputType);
RowType udfOutputType = (RowType) Projection.range(inputType.getFieldCount(), outputType.getFieldCount()).project(outputType);
return new PassThroughStreamArrowPythonRowTimeBoundedRowsOperator(config, pandasAggregateFunctions, inputType, udfInputType, udfOutputType, 3, 1, ProjectionCodeGenerator.generateProjection(CodeGeneratorContext.apply(new TableConfig()), "UdafInputProjection", inputType, udfInputType, udafInputOffsets));
}
use of org.apache.flink.table.api.TableConfig in project flink by apache.
the class PythonScalarFunctionOperatorTest method getTestOperator.
@Override
public AbstractPythonScalarFunctionOperator getTestOperator(Configuration config, PythonFunctionInfo[] scalarFunctions, RowType inputType, RowType outputType, int[] udfInputOffsets, int[] forwardedFields) {
final RowType udfInputType = (RowType) Projection.of(udfInputOffsets).project(inputType);
final RowType forwardedFieldType = (RowType) Projection.of(forwardedFields).project(inputType);
final RowType udfOutputType = (RowType) Projection.range(forwardedFields.length, outputType.getFieldCount()).project(outputType);
return new PassThroughPythonScalarFunctionOperator(config, scalarFunctions, inputType, udfInputType, udfOutputType, ProjectionCodeGenerator.generateProjection(CodeGeneratorContext.apply(new TableConfig()), "UdfInputProjection", inputType, udfInputType, udfInputOffsets), ProjectionCodeGenerator.generateProjection(CodeGeneratorContext.apply(new TableConfig()), "ForwardedFieldProjection", inputType, forwardedFieldType, forwardedFields));
}
use of org.apache.flink.table.api.TableConfig in project flink by apache.
the class ArrowPythonScalarFunctionOperatorTest method getTestOperator.
@Override
public ArrowPythonScalarFunctionOperator getTestOperator(Configuration config, PythonFunctionInfo[] scalarFunctions, RowType inputType, RowType outputType, int[] udfInputOffsets, int[] forwardedFields) {
final RowType udfInputType = (RowType) Projection.of(udfInputOffsets).project(inputType);
final RowType forwardedFieldType = (RowType) Projection.of(forwardedFields).project(inputType);
final RowType udfOutputType = (RowType) Projection.range(forwardedFields.length, outputType.getFieldCount()).project(outputType);
return new PassThroughRowDataArrowPythonScalarFunctionOperator(config, scalarFunctions, inputType, udfInputType, udfOutputType, ProjectionCodeGenerator.generateProjection(CodeGeneratorContext.apply(new TableConfig()), "UdfInputProjection", inputType, udfInputType, udfInputOffsets), ProjectionCodeGenerator.generateProjection(CodeGeneratorContext.apply(new TableConfig()), "ForwardedFieldProjection", inputType, forwardedFieldType, forwardedFields));
}
use of org.apache.flink.table.api.TableConfig in project flink by apache.
the class TableEnvironmentMock method getInstance.
private static TableEnvironmentMock getInstance(boolean isStreamingMode) {
final TableConfig tableConfig = createTableConfig();
final CatalogManager catalogManager = CatalogManagerMocks.createEmptyCatalogManager();
final ModuleManager moduleManager = new ModuleManager();
return new TableEnvironmentMock(catalogManager, moduleManager, tableConfig, createExecutor(), createFunctionCatalog(tableConfig, catalogManager, moduleManager), createPlanner(), isStreamingMode);
}
use of org.apache.flink.table.api.TableConfig in project flink by apache.
the class TableEnvironmentImpl method create.
private static TableEnvironmentImpl create(EnvironmentSettings settings, Configuration configuration) {
// temporary solution until FLINK-15635 is fixed
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
// use configuration to init table config
final TableConfig tableConfig = new TableConfig();
tableConfig.addConfiguration(configuration);
final ModuleManager moduleManager = new ModuleManager();
final CatalogManager catalogManager = CatalogManager.newBuilder().classLoader(classLoader).config(tableConfig.getConfiguration()).defaultCatalog(settings.getBuiltInCatalogName(), new GenericInMemoryCatalog(settings.getBuiltInCatalogName(), settings.getBuiltInDatabaseName())).build();
final FunctionCatalog functionCatalog = new FunctionCatalog(tableConfig, catalogManager, moduleManager);
final ExecutorFactory executorFactory = FactoryUtil.discoverFactory(classLoader, ExecutorFactory.class, settings.getExecutor());
final Executor executor = executorFactory.create(configuration);
final Planner planner = PlannerFactoryUtil.createPlanner(settings.getPlanner(), executor, tableConfig, moduleManager, catalogManager, functionCatalog);
return new TableEnvironmentImpl(catalogManager, moduleManager, tableConfig, executor, functionCatalog, planner, settings.isStreamingMode(), classLoader);
}
Aggregations