当前位置: 首页>>代码示例>>Java>>正文


Java Prepare.CatalogReader方法代码示例

本文整理汇总了Java中org.apache.calcite.prepare.Prepare.CatalogReader方法的典型用法代码示例。如果您正苦于以下问题:Java Prepare.CatalogReader方法的具体用法?Java Prepare.CatalogReader怎么用?Java Prepare.CatalogReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.calcite.prepare.Prepare的用法示例。


在下文中一共展示了Prepare.CatalogReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SqlToRelConverter

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
public SqlToRelConverter(
	RelOptTable.ViewExpander viewExpander,
	SqlValidator validator,
	Prepare.CatalogReader catalogReader,
	RelOptCluster cluster,
	SqlRexConvertletTable convertletTable,
	Config config) {
	this.viewExpander = viewExpander;
	this.opTab =
		(validator
			== null) ? SqlStdOperatorTable.instance()
			: validator.getOperatorTable();
	this.validator = validator;
	this.catalogReader = catalogReader;
	this.subQueryConverter = new NoOpSubQueryConverter();
	this.rexBuilder = cluster.getRexBuilder();
	this.typeFactory = rexBuilder.getTypeFactory();
	this.cluster = Preconditions.checkNotNull(cluster);
	this.exprConverter = new SqlNodeToRexConverterImpl(convertletTable);
	this.explainParamCount = 0;
	this.config = new ConfigBuilder().withConfig(config).build();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:23,代码来源:SqlToRelConverter.java

示例2: JdbcTableModify

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
public JdbcTableModify(RelOptCluster cluster,
                       RelTraitSet traitSet,
                       RelOptTable table,
                       Prepare.CatalogReader catalogReader,
                       RelNode input,
                       Operation operation,
                       List<String> updateColumnList,
                       boolean flattened) {
    super(cluster, traitSet, table, catalogReader, input, operation,
            updateColumnList, flattened);
    assert input.getConvention() instanceof JdbcConvention;
    assert getConvention() instanceof JdbcConvention;
    final ModifiableTable modifiableTable =
            table.unwrap(ModifiableTable.class);
    if (modifiableTable == null) {
        throw new AssertionError(); // TODO: user error in validator
    }
    this.expression = table.getExpression(Queryable.class);
    if (expression == null) {
        throw new AssertionError(); // TODO: user error in validator
    }
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:23,代码来源:JdbcRules.java

示例3: SqlToRelConverter

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
public SqlToRelConverter(
    RelOptTable.ViewExpander viewExpander,
    SqlValidator validator,
    Prepare.CatalogReader catalogReader,
    RelOptCluster cluster,
    SqlRexConvertletTable convertletTable,
    Config config) {
  this.viewExpander = viewExpander;
  this.opTab =
      (validator
          == null) ? SqlStdOperatorTable.instance()
          : validator.getOperatorTable();
  this.validator = validator;
  this.catalogReader = catalogReader;
  this.subQueryConverter = new NoOpSubQueryConverter();
  this.rexBuilder = cluster.getRexBuilder();
  this.typeFactory = rexBuilder.getTypeFactory();
  this.cluster = Preconditions.checkNotNull(cluster);
  this.exprConverter = new SqlNodeToRexConverterImpl(convertletTable);
  this.explainParamCount = 0;
  this.config = new ConfigBuilder().withConfig(config).build();
}
 
开发者ID:apache,项目名称:kylin,代码行数:23,代码来源:SqlToRelConverter.java

示例4: JdbcTableModify

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
public JdbcTableModify(RelOptCluster cluster,
    RelTraitSet traitSet,
    RelOptTable table,
    Prepare.CatalogReader catalogReader,
    RelNode input,
    Operation operation,
    List<String> updateColumnList,
    List<RexNode> sourceExpressionList,
    boolean flattened) {
  super(cluster, traitSet, table, catalogReader, input, operation,
      updateColumnList, sourceExpressionList, flattened);
  assert input.getConvention() instanceof JdbcConvention;
  assert getConvention() instanceof JdbcConvention;
  final ModifiableTable modifiableTable =
      table.unwrap(ModifiableTable.class);
  if (modifiableTable == null) {
    throw new AssertionError(); // TODO: user error in validator
  }
  this.expression = table.getExpression(Queryable.class);
  if (expression == null) {
    throw new AssertionError(); // TODO: user error in validator
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:24,代码来源:JdbcRules.java

示例5: SqlToRelConverter

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
public SqlToRelConverter(
    RelOptTable.ViewExpander viewExpander,
    SqlValidator validator,
    Prepare.CatalogReader catalogReader,
    RelOptCluster cluster,
    SqlRexConvertletTable convertletTable,
    Config config) {
  this.viewExpander = viewExpander;
  this.opTab =
      (validator
          == null) ? SqlStdOperatorTable.instance()
          : validator.getOperatorTable();
  this.validator = validator;
  this.catalogReader = catalogReader;
  this.subQueryConverter = new NoOpSubQueryConverter();
  this.rexBuilder = cluster.getRexBuilder();
  this.typeFactory = rexBuilder.getTypeFactory();
  this.cluster = Preconditions.checkNotNull(cluster);
  this.exprConverter = new SqlNodeToRexConverterImpl(convertletTable);
  this.explainParamCount = 0;
  this.config = new ConfigBuilder().withConfig(config).build();
  this.relBuilder = config.getRelBuilderFactory().create(cluster, null);
}
 
开发者ID:apache,项目名称:calcite,代码行数:24,代码来源:SqlToRelConverter.java

示例6: getRelOptTable

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
private static RelOptTable getRelOptTable(
    TableNamespace tableNamespace,
    Prepare.CatalogReader catalogReader,
    String datasetName,
    boolean[] usedDataset,
    List<RelDataTypeField> extendedFields) {
  final List<String> names = tableNamespace.getTable().getQualifiedName();
  RelOptTable table;
  if (datasetName != null
      && catalogReader instanceof RelOptSchemaWithSampling) {
    final RelOptSchemaWithSampling reader =
        (RelOptSchemaWithSampling) catalogReader;
    table = reader.getTableForMember(names, datasetName, usedDataset);
  } else {
    // Schema does not support substitution. Ignore the data set, if any.
    table = catalogReader.getTableForMember(names);
  }
  if (!extendedFields.isEmpty()) {
    table = table.extend(extendedFields);
  }
  return table;
}
 
开发者ID:apache,项目名称:calcite,代码行数:23,代码来源:SqlValidatorUtil.java

示例7: TesterImpl

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
protected TesterImpl(DiffRepository diffRepos, boolean enableDecorrelate,
    boolean enableTrim, boolean enableExpand, boolean enableLateDecorrelate,
    Function<RelDataTypeFactory, Prepare.CatalogReader>
        catalogReaderFactory,
    Function<RelOptCluster, RelOptCluster> clusterFactory,
    SqlToRelConverter.Config config, SqlConformance conformance,
    Context context) {
  this.diffRepos = diffRepos;
  this.enableDecorrelate = enableDecorrelate;
  this.enableTrim = enableTrim;
  this.enableExpand = enableExpand;
  this.enableLateDecorrelate = enableLateDecorrelate;
  this.catalogReaderFactory = catalogReaderFactory;
  this.clusterFactory = clusterFactory;
  this.config = config;
  this.conformance = conformance;
  this.context = context;
}
 
开发者ID:apache,项目名称:calcite,代码行数:19,代码来源:SqlToRelTestBase.java

示例8: convert

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
  final TableModify tableModify = (TableModify) rel;
  final RelNode input = tableModify.getInput();

  final RelOptCluster cluster = tableModify.getCluster();
  final RelTraitSet traitSet = tableModify.getTraitSet().replace(BeamLogicalConvention.INSTANCE);
  final RelOptTable relOptTable = tableModify.getTable();
  final Prepare.CatalogReader catalogReader = tableModify.getCatalogReader();
  final RelNode convertedInput = convert(input,
      input.getTraitSet().replace(BeamLogicalConvention.INSTANCE));
  final TableModify.Operation operation = tableModify.getOperation();
  final List<String> updateColumnList = tableModify.getUpdateColumnList();
  final List<RexNode> sourceExpressionList = tableModify.getSourceExpressionList();
  final boolean flattened = tableModify.isFlattened();

  final Table table = tableModify.getTable().unwrap(Table.class);

  switch (table.getJdbcTableType()) {
  case TABLE:
  case STREAM:
    if (operation != TableModify.Operation.INSERT) {
      throw new UnsupportedOperationException(
          String.format("Streams doesn't support %s modify operation", operation));
    }
    return new BeamIOSinkRel(cluster, traitSet,
        relOptTable, catalogReader, convertedInput, operation, updateColumnList,
        sourceExpressionList, flattened);
  default:
    throw new IllegalArgumentException(
        String.format("Unsupported table type: %s", table.getJdbcTableType()));
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:34,代码来源:BeamIOSinkRule.java

示例9: toModificationRel

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
public TableModify toModificationRel(
    RelOptCluster cluster,
    RelOptTable table,
    Prepare.CatalogReader catalogReader,
    RelNode child,
    TableModify.Operation operation,
    List<String> updateColumnList,
    List<RexNode> sourceExpressionList,
    boolean flattened) {
  return LogicalTableModify.create(table, catalogReader, child, operation,
      updateColumnList, sourceExpressionList, flattened);
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:SqlCreateTable.java

示例10: MutableTableModify

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
private MutableTableModify(RelDataType rowType, MutableRel input,
    RelOptTable table, Prepare.CatalogReader catalogReader,
    Operation operation, List<String> updateColumnList,
    List<RexNode> sourceExpressionList, boolean flattened) {
  super(MutableRelType.TABLE_MODIFY, rowType, input);
  this.table = table;
  this.catalogReader = catalogReader;
  this.operation = operation;
  this.updateColumnList = updateColumnList;
  this.sourceExpressionList = sourceExpressionList;
  this.flattened = flattened;
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:MutableTableModify.java

示例11: LogicalTableModify

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
/**
 * Creates a LogicalTableModify.
 *
 * <p>Use {@link #create} unless you know what you're doing.
 */
public LogicalTableModify(RelOptCluster cluster, RelTraitSet traitSet,
    RelOptTable table, Prepare.CatalogReader schema, RelNode input,
    Operation operation, List<String> updateColumnList,
    List<RexNode> sourceExpressionList, boolean flattened) {
  super(cluster, traitSet, table, schema, input, operation, updateColumnList,
      sourceExpressionList, flattened);
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:LogicalTableModify.java

示例12: create

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
/** Creates a LogicalTableModify. */
public static LogicalTableModify create(RelOptTable table,
    Prepare.CatalogReader schema, RelNode input,
    Operation operation, List<String> updateColumnList,
    List<RexNode> sourceExpressionList, boolean flattened) {
  final RelOptCluster cluster = input.getCluster();
  final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE);
  return new LogicalTableModify(cluster, traitSet, table, schema, input,
      operation, updateColumnList, sourceExpressionList, flattened);
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:LogicalTableModify.java

示例13: TableModify

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
/**
 * Creates a {@code TableModify}.
 *
 * <p>The UPDATE operation has format like this:
 * <blockquote>
 *   <pre>UPDATE table SET iden1 = exp1, ident2 = exp2  WHERE condition</pre>
 * </blockquote>
 *
 * @param cluster    Cluster this relational expression belongs to
 * @param traitSet   Traits of this relational expression
 * @param table      Target table to modify
 * @param catalogReader accessor to the table metadata.
 * @param input      Sub-query or filter condition
 * @param operation  Modify operation (INSERT, UPDATE, DELETE)
 * @param updateColumnList List of column identifiers to be updated
 *           (e.g. ident1, ident2); null if not UPDATE
 * @param sourceExpressionList List of value expressions to be set
 *           (e.g. exp1, exp2); null if not UPDATE
 * @param flattened Whether set flattens the input row type
 */
protected TableModify(
    RelOptCluster cluster,
    RelTraitSet traitSet,
    RelOptTable table,
    Prepare.CatalogReader catalogReader,
    RelNode input,
    Operation operation,
    List<String> updateColumnList,
    List<RexNode> sourceExpressionList,
    boolean flattened) {
  super(cluster, traitSet, input);
  this.table = table;
  this.catalogReader = catalogReader;
  this.operation = operation;
  this.updateColumnList = updateColumnList;
  this.sourceExpressionList = sourceExpressionList;
  if (operation == Operation.UPDATE) {
    Preconditions.checkNotNull(updateColumnList);
    Preconditions.checkNotNull(sourceExpressionList);
    Preconditions.checkArgument(sourceExpressionList.size()
        == updateColumnList.size());
  } else {
    Preconditions.checkArgument(updateColumnList == null);
    Preconditions.checkArgument(sourceExpressionList == null);
  }
  if (table.getRelOptSchema() != null) {
    cluster.getPlanner().registerSchema(table.getRelOptSchema());
  }
  this.flattened = flattened;
}
 
开发者ID:apache,项目名称:calcite,代码行数:51,代码来源:TableModify.java

示例14: EnumerableTableModify

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
public EnumerableTableModify(RelOptCluster cluster, RelTraitSet traits,
    RelOptTable table, Prepare.CatalogReader catalogReader, RelNode child,
    Operation operation, List<String> updateColumnList,
    List<RexNode> sourceExpressionList, boolean flattened) {
  super(cluster, traits, table, catalogReader, child, operation,
      updateColumnList, sourceExpressionList, flattened);
  assert child.getConvention() instanceof EnumerableConvention;
  assert getConvention() instanceof EnumerableConvention;
  final ModifiableTable modifiableTable =
      table.unwrap(ModifiableTable.class);
  if (modifiableTable == null) {
    throw new AssertionError(); // TODO: user error in validator
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:15,代码来源:EnumerableTableModify.java

示例15: createSqlToRelConverter

import org.apache.calcite.prepare.Prepare; //导入方法依赖的package包/类
protected SqlToRelConverter createSqlToRelConverter(
    final SqlValidator validator,
    final Prepare.CatalogReader catalogReader,
    final RelDataTypeFactory typeFactory,
    final SqlToRelConverter.Config config) {
  final RexBuilder rexBuilder = new RexBuilder(typeFactory);
  RelOptCluster cluster =
      RelOptCluster.create(getPlanner(), rexBuilder);
  if (clusterFactory != null) {
    cluster = clusterFactory.apply(cluster);
  }
  return new SqlToRelConverter(null, validator, catalogReader, cluster,
      StandardConvertletTable.INSTANCE, config);
}
 
开发者ID:apache,项目名称:calcite,代码行数:15,代码来源:SqlToRelTestBase.java


注:本文中的org.apache.calcite.prepare.Prepare.CatalogReader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。