org.apache.calcite.plan.RelOptUtil.inferViewPredicates()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(70)

本文整理了Java中org.apache.calcite.plan.RelOptUtil.inferViewPredicates方法的一些代码示例,展示了RelOptUtil.inferViewPredicates的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RelOptUtil.inferViewPredicates方法的具体详情如下:
包路径:org.apache.calcite.plan.RelOptUtil
类名称:RelOptUtil
方法名:inferViewPredicates

RelOptUtil.inferViewPredicates介绍

[英]Decomposes the WHERE clause of a view into predicates that constraint a column to a particular value.

This method is key to the validation of a modifiable view. Columns that are constrained to a single value can be omitted from the SELECT clause of a modifiable view.
[中]将视图的WHERE子句分解为将列约束为特定值的谓词。
此方法是验证可修改视图的关键。可以从可修改视图的SELECT子句中忽略约束为单个值的列。

代码示例

代码示例来源:origin: Qihoo360/Quicksql

private ModifiableViewTableInitializerExpressionFactory() {
 super();
 final Map<Integer, RexNode> projectMap = new HashMap<>();
 final List<RexNode> filters = new ArrayList<>();
 RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
 assert filters.isEmpty();
 this.projectMap = ImmutableMap.copyOf(projectMap);
}

代码示例来源:origin: org.apache.calcite/calcite-core

private ModifiableViewTableInitializerExpressionFactory() {
 super();
 final Map<Integer, RexNode> projectMap = new HashMap<>();
 final List<RexNode> filters = new ArrayList<>();
 RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
 assert filters.isEmpty();
 this.projectMap = ImmutableMap.copyOf(projectMap);
}

代码示例来源:origin: org.apache.calcite/calcite-core

/**
 * Returns a mapping of the column ordinal in the underlying table to a column
 * constraint of the modifiable view.
 *
 * @param modifiableViewTable The modifiable view which has a constraint
 * @param targetRowType       The target type
 */
public static Map<Integer, RexNode> getColumnConstraints(
  ModifiableView modifiableViewTable, RelDataType targetRowType,
  RelDataTypeFactory typeFactory) {
 final RexBuilder rexBuilder = new RexBuilder(typeFactory);
 final RexNode constraint =
   modifiableViewTable.getConstraint(rexBuilder, targetRowType);
 final Map<Integer, RexNode> projectMap = new HashMap<>();
 final List<RexNode> filters = new ArrayList<>();
 RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
 assert filters.isEmpty();
 return projectMap;
}

代码示例来源:origin: Qihoo360/Quicksql

/**
 * Returns a mapping of the column ordinal in the underlying table to a column
 * constraint of the modifiable view.
 *
 * @param modifiableViewTable The modifiable view which has a constraint
 * @param targetRowType       The target type
 */
public static Map<Integer, RexNode> getColumnConstraints(
  ModifiableView modifiableViewTable, RelDataType targetRowType,
  RelDataTypeFactory typeFactory) {
 final RexBuilder rexBuilder = new RexBuilder(typeFactory);
 final RexNode constraint =
   modifiableViewTable.getConstraint(rexBuilder, targetRowType);
 final Map<Integer, RexNode> projectMap = new HashMap<>();
 final List<RexNode> filters = new ArrayList<>();
 RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
 assert filters.isEmpty();
 return projectMap;
}

代码示例来源:origin: org.apache.kylin/atopcalcite

RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
final List<Pair<RexNode, String>> projects = new ArrayList<>();
for (RelDataTypeField field : delegateRowType.getFieldList()) {

代码示例来源:origin: org.apache.flink/flink-table_2.10

RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
final List<Pair<RexNode, String>> projects = new ArrayList<>();
for (RelDataTypeField field : delegateRowType.getFieldList()) {

代码示例来源:origin: Qihoo360/Quicksql

RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
final List<Pair<RexNode, String>> projects = new ArrayList<>();
for (RelDataTypeField field : delegateRowType.getFieldList()) {

代码示例来源:origin: org.apache.kylin/atopcalcite

RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
if (fail && !filters.isEmpty()) {
 final Map<Integer, RexNode> projectMap2 = new HashMap<>();
 RelOptUtil.inferViewPredicates(projectMap2, filters2, constraint);
 if (!filters2.isEmpty()) {
  throw validator.newValidationError(sqlNode,

代码示例来源:origin: org.apache.calcite/calcite-core

RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
final List<Pair<RexNode, String>> projects = new ArrayList<>();
for (RelDataTypeField field : delegateRowType.getFieldList()) {

代码示例来源:origin: org.apache.calcite/calcite-core

RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
if (fail && !filters.isEmpty()) {
 final Map<Integer, RexNode> projectMap2 = new HashMap<>();
 RelOptUtil.inferViewPredicates(projectMap2, filters2, constraint);
 if (!filters2.isEmpty()) {
  throw validator.newValidationError(sqlNode,

代码示例来源:origin: Qihoo360/Quicksql

RelOptUtil.inferViewPredicates(projectMap, filters, constraint);
if (fail && !filters.isEmpty()) {
 final Map<Integer, RexNode> projectMap2 = new HashMap<>();
 RelOptUtil.inferViewPredicates(projectMap2, filters2, constraint);
 if (!filters2.isEmpty()) {
  throw validator.newValidationError(sqlNode,

相关文章

微信公众号

最新文章

更多

RelOptUtil类方法