本文整理汇总了Java中org.apache.calcite.plan.RelOptCluster.create方法的典型用法代码示例。如果您正苦于以下问题:Java RelOptCluster.create方法的具体用法?Java RelOptCluster.create怎么用?Java RelOptCluster.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.plan.RelOptCluster
的用法示例。
在下文中一共展示了RelOptCluster.create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import org.apache.calcite.plan.RelOptCluster; //导入方法依赖的package包/类
@Before
public void setup() {
optionManager = mock(OptionManager.class);
when(optionManager.getOption(eq(ExecConstants.SLICE_TARGET)))
.thenReturn(ExecConstants.SLICE_TARGET_OPTION.getDefault());
when(optionManager.getOption(eq(PlannerSettings.ENABLE_LEAF_LIMITS.getOptionName())))
.thenReturn(PlannerSettings.ENABLE_LEAF_LIMITS.getDefault());
when(optionManager.getOption(eq(PlannerSettings.ENABLE_TRIVIAL_SINGULAR.getOptionName())))
.thenReturn(PlannerSettings.ENABLE_TRIVIAL_SINGULAR.getDefault());
plannerSettings = new PlannerSettings(optionManager, null, null);
cluster = RelOptCluster.create(new VolcanoPlanner(plannerSettings), rexBuilder);
}
示例2: setup
import org.apache.calcite.plan.RelOptCluster; //导入方法依赖的package包/类
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
final VolcanoPlanner planner = new VolcanoPlanner();
typeFactory = new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
RelOptCluster cluster = RelOptCluster.create(planner, new RexBuilder(typeFactory));
builder = DremioRelFactories.LOGICAL_BUILDER.create(cluster, schema);
}
示例3: SqlConverter
import org.apache.calcite.plan.RelOptCluster; //导入方法依赖的package包/类
public SqlConverter(
final PlannerSettings settings,
final SchemaPlus defaultSchema,
final SqlOperatorTable operatorTable,
final FunctionContext functionContext,
final MaterializationDescriptorProvider materializationProvider,
final FunctionImplementationRegistry functions,
final UserSession session,
final AttemptObserver observer,
final StoragePluginRegistry registry,
final SubstitutionProviderFactory factory
) {
this.nestingLevel = 0;
this.flattenCounter = new FlattenOpCounter();
this.observer = observer;
this.settings = settings;
this.functionContext = functionContext;
this.functions = functions;
this.session = Preconditions.checkNotNull(session, "user session is required");
this.parserConfig = ParserConfig.newInstance(session, settings);
this.isInnerQuery = false;
this.typeFactory = new JavaTypeFactoryImpl(TYPE_SYSTEM);
this.defaultSchema = defaultSchema;
this.rootSchema = rootSchema(defaultSchema);
this.catalog = new CalciteCatalogReader(
CalciteSchema.from(rootSchema),
parserConfig.caseSensitive(),
CalciteSchema.from(defaultSchema).path(null),
typeFactory);
// set catalog for MaterializedViewTable to create a deserializer
settings.setCatalog(catalog);
this.opTab = new ChainedSqlOperatorTable(Arrays.asList(operatorTable, catalog));
this.costFactory = (settings.useDefaultCosting()) ? null : new DremioCost.Factory();
this.validator = new SqlValidatorImpl(flattenCounter, opTab, catalog, typeFactory, DremioSqlConformance.INSTANCE);
validator.setIdentifierExpansion(true);
this.materializations = new MaterializationList(this, session, materializationProvider);
this.substitutions = AccelerationAwareSubstitutionProvider.of(factory.getSubstitutionProvider(materializations, this.settings.options));
this.planner = new DremioVolcanoPlanner(this);
this.cluster = RelOptCluster.create(planner, new DremioRexBuilder(typeFactory));
this.cluster.setMetadataProvider(DefaultRelMetadataProvider.INSTANCE);
this.registry = Preconditions.checkNotNull(registry, "registry cannot be null");
}