• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TableModify类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.calcite.rel.core.TableModify的典型用法代码示例。如果您正苦于以下问题:Java TableModify类的具体用法?Java TableModify怎么用?Java TableModify使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TableModify类属于org.apache.calcite.rel.core包,在下文中一共展示了TableModify类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: insertCopying

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
public JdbcRelBuilder insertCopying(
		LogicalTableModify original,
		Table table
) {
	List<String> name = JdbcTableUtils.getQualifiedName(original.getTable(), table);

	push(new LogicalTableModify(
			cluster,
			original.getTraitSet(),
			relOptSchema.getTableForMember(name),
			original.getCatalogReader(),
			peek(),
			TableModify.Operation.INSERT,
			null,
			null,
			original.isFlattened()
	));
	return this;
}
 
开发者ID:tzolov,项目名称:calcite-sql-rewriter,代码行数:20,代码来源:JdbcRelBuilder.java


示例2: visit

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
@Override
public RelInfo visit(RelContext context, RelNode node, List<RelInfo> inputStreams)
{
  /**
   * Only INSERT is allowed as it representation destination for DAG processing. Other types like UPDATE, DELETE,
   * MERGE does not represent the same.
   */

  TableModify modify = (TableModify)node;
  Preconditions.checkArgument(modify.isInsert(), "Only INSERT allowed for table modify");

  ApexSQLTable table = modify.getTable().unwrap(ApexSQLTable.class);

  Endpoint endpoint = table.getEndpoint();
  return endpoint.populateOutputDAG(context.dag, context.typeFactory);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:17,代码来源:ApexRelNode.java


示例3: convert

import org.apache.calcite.rel.core.TableModify; //导入依赖的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


示例4: traverse

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
public final T traverse(RelNode n) throws Exception {
  List<T> inputStreams = new ArrayList<>();
  for (RelNode input : n.getInputs()) {
    inputStreams.add(traverse(input));
  }

  if (n instanceof Aggregate) {
    return visitAggregate((Aggregate) n, inputStreams);
  } else if (n instanceof Calc) {
    return visitCalc((Calc) n, inputStreams);
  } else if (n instanceof Collect) {
    return visitCollect((Collect) n, inputStreams);
  } else if (n instanceof Correlate) {
    return visitCorrelate((Correlate) n, inputStreams);
  } else if (n instanceof Delta) {
    return visitDelta((Delta) n, inputStreams);
  } else if (n instanceof Exchange) {
    return visitExchange((Exchange) n, inputStreams);
  } else if (n instanceof Project) {
    return visitProject((Project) n, inputStreams);
  } else if (n instanceof Filter) {
    return visitFilter((Filter) n, inputStreams);
  } else if (n instanceof Sample) {
    return visitSample((Sample) n, inputStreams);
  } else if (n instanceof Sort) {
    return visitSort((Sort) n, inputStreams);
  } else if (n instanceof TableModify) {
    return visitTableModify((TableModify) n, inputStreams);
  } else if (n instanceof TableScan) {
    return visitTableScan((TableScan) n, inputStreams);
  } else if (n instanceof Uncollect) {
    return visitUncollect((Uncollect) n, inputStreams);
  } else if (n instanceof Window) {
    return visitWindow((Window) n, inputStreams);
  } else if (n instanceof Join) {
    return visitJoin((Join) n, inputStreams);
  } else {
    return defaultValue(n, inputStreams);
  }
}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:41,代码来源:PostOrderRelNodeVisitor.java


示例5: visitChild

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
public Result visitChild(int i, RelNode e) {
  if (e instanceof Union) {
    return visitUnion((Union) e);
  } else if (e instanceof Join) {
    return visitJoin((Join) e);
  } else if (e instanceof Filter) {
    return visitFilter((Filter) e);
  } else if (e instanceof Project) {
    return visitProject((Project) e);
  } else if (e instanceof Aggregate) {
    return visitAggregate((Aggregate) e);
  } else if (e instanceof TableScan) {
    return visitTableScan((TableScan) e);
  } else if (e instanceof Intersect) {
    return visitIntersect((Intersect) e);
  } else if (e instanceof Minus) {
    return visitMinus((Minus) e);
  } else if (e instanceof Calc) {
    return visitCalc((Calc) e);
  } else if (e instanceof Sort) {
    return visitSort((Sort) e);
  } else if (e instanceof TableModify) {
    return visitTableModify((TableModify) e);
  } else if (e instanceof Limit) {
    return visitLimit((Limit) e);
  } else {
    throw new AssertionError("Need to Implement for " + e.getClass().getName()); // TODO:
  }
}
 
开发者ID:qubole,项目名称:quark,代码行数:30,代码来源:RelToSqlConverter.java


示例6: toModificationRel

import org.apache.calcite.rel.core.TableModify; //导入依赖的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


示例7: toModificationRel

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
@Override public TableModify toModificationRel(RelOptCluster cluster,
    RelOptTable table, CatalogReader catalogReader, RelNode input,
    Operation operation, List<String> updateColumnList,
    List<RexNode> sourceExpressionList, boolean flattened) {
  jdbcSchema.convention.register(cluster.getPlanner());

  return new LogicalTableModify(cluster, cluster.traitSetOf(Convention.NONE),
      table, catalogReader, input, operation, updateColumnList,
      sourceExpressionList, flattened);
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:JdbcTable.java


示例8: toModificationRel

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
/** Creates a relational expression that modifies this table. */
TableModify toModificationRel(
    RelOptCluster cluster,
    RelOptTable table,
    Prepare.CatalogReader catalogReader,
    RelNode child,
    TableModify.Operation operation,
    List<String> updateColumnList,
    List<RexNode> sourceExpressionList,
    boolean flattened);
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:ModifiableTable.java


示例9: visit

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
public void visit(
    RelNode p,
    int ordinal,
    RelNode parent) {
  super.visit(p, ordinal, parent);
  RelOptTable table = p.getTable();
  if (table == null) {
    return;
  }
  Mode newAccess;

  // FIXME jvs 1-Feb-2006:  Don't rely on object type here;
  // eventually someone is going to write a rule which transforms
  // to something which doesn't inherit TableModify,
  // and this will break.  Need to make this explicit in
  // the RelNode interface.
  if (p instanceof TableModify) {
    newAccess = Mode.WRITE_ACCESS;
  } else {
    newAccess = Mode.READ_ACCESS;
  }
  List<String> key = getQualifiedName(table);
  Mode oldAccess = accessMap.get(key);
  if ((oldAccess != null) && (oldAccess != newAccess)) {
    newAccess = Mode.READWRITE_ACCESS;
  }
  accessMap.put(key, newAccess);
}
 
开发者ID:apache,项目名称:calcite,代码行数:29,代码来源:TableAccessMap.java


示例10: toModificationRel

import org.apache.calcite.rel.core.TableModify; //导入依赖的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,代码行数:8,代码来源:FrameworksTest.java


示例11: convertToDrel

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
/**
 *  Given a relNode tree for SELECT statement, convert to Dremio Logical RelNode tree.
 * @param relNode
 * @return
 * @throws SqlUnsupportedException
 * @throws RelConversionException
 */
public static Rel convertToDrel(SqlHandlerConfig config, final RelNode relNode) throws SqlUnsupportedException, RelConversionException {

  try {
    final RelNode convertedRelNode;

    final RelTraitSet logicalTraits = relNode.getTraitSet().plus(Rel.LOGICAL);

    final RelNode intermediateNode = transform(config, PlannerType.VOLCANO, PlannerPhase.LOGICAL, relNode, logicalTraits, true);

    // Do Join Planning.
    convertedRelNode = transform(config, PlannerType.HEP_BOTTOM_UP, PlannerPhase.JOIN_PLANNING, intermediateNode, intermediateNode.getTraitSet(), true);

    FlattenRelFinder flattenFinder = new FlattenRelFinder();
    final RelNode flattendPushed;
    if (flattenFinder.run(convertedRelNode)) {
      flattendPushed = transform(config, PlannerType.VOLCANO, PlannerPhase.FLATTEN_PUSHDOWN, convertedRelNode, convertedRelNode.getTraitSet(), true);
    } else {
      flattendPushed = convertedRelNode;
    }

    final Rel drel = (Rel) flattendPushed;

    if (drel instanceof TableModify) {
      throw new UnsupportedOperationException("TableModify " + drel);
    } else {
      final Optional<SubstitutionInfo> acceleration = findUsedMaterializations(config, drel);
      if (acceleration.isPresent()) {
        config.getObserver().planAccelerated(acceleration.get());
      }
      return drel;
    }
  } catch (RelOptPlanner.CannotPlanException ex) {
    logger.error(ex.getMessage(), ex);

    if(JoinUtils.checkCartesianJoin(relNode, Lists.<Integer>newArrayList(), Lists.<Integer>newArrayList(), Lists.<Boolean>newArrayList())) {
      throw new UnsupportedRelOperatorException("This query cannot be planned possibly due to either a cartesian join or an inequality join");
    } else {
      throw ex;
    }
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:49,代码来源:PrelTransformer.java


示例12: toModificationRel

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
@Override
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:diennea,项目名称:herddb,代码行数:6,代码来源:CalcitePlanner.java


示例13: visitTableModify

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
public T visitTableModify(TableModify modify, List<T> inputStreams) throws Exception {
  return defaultValue(modify, inputStreams);
}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:4,代码来源:PostOrderRelNodeVisitor.java


示例14: visitTableModify

import org.apache.calcite.rel.core.TableModify; //导入依赖的package包/类
public Result visitTableModify(TableModify e) {
  throw new AssertionError(); // TODO:
}
 
开发者ID:qubole,项目名称:quark,代码行数:4,代码来源:RelToSqlConverter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RegistrationInformation类代码示例发布时间:2022-05-22
下一篇:
Java CMenuBar类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap