org.apache.calcite.rel.core.Project.getMapping()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(121)

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

Project.getMapping介绍

[英]Returns a mapping, or null if this projection is not a mapping.
[中]返回映射,如果此投影不是映射,则返回null。

代码示例

代码示例来源:origin: apache/drill

public Mappings.TargetMapping getMapping() {
  return Project.getMapping(
    input.getRowType().getFieldCount(), projects);
 }
}

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

public Mappings.TargetMapping getMapping() {
 return Project.getMapping(input.rowType.getFieldCount(), projects);
}

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

public Mappings.TargetMapping getMapping() {
 return Project.getMapping(input.rowType.getFieldCount(), projects);
}

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

private static ProjectFilterTable of2(RexNode condition, RelNode node) {
 if (node instanceof Project) {
  final Project project = (Project) node;
  return of3(condition, project.getMapping(), project.getInput());
 } else {
  return of3(condition, null, node);
 }
}

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

private static ProjectFilterTable of2(RexNode condition, RelNode node) {
 if (node instanceof Project) {
  final Project project = (Project) node;
  return of3(condition, project.getMapping(), project.getInput());
 } else {
  return of3(condition, null, node);
 }
}

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

/**
 * Returns a mapping, or null if this projection is not a mapping.
 *
 * @return Mapping, or null if this projection is not a mapping
 */
public Mappings.TargetMapping getMapping() {
 return getMapping(getInput().getRowType().getFieldCount(), exps);
}

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

/**
 * Returns a mapping, or null if this projection is not a mapping.
 *
 * @return Mapping, or null if this projection is not a mapping
 */
public Mappings.TargetMapping getMapping() {
 return getMapping(getInput().getRowType().getFieldCount(), exps);
}

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

protected void apply(RelOptRuleCall call, Project project, TableScan scan) {
  final RelOptTable table = scan.getTable();
  assert table.unwrap(ProjectableFilterableTable.class) != null;

  final Mappings.TargetMapping mapping = project.getMapping();
  if (mapping == null
    || Mappings.isIdentity(mapping)) {
   return;
  }

  final ImmutableIntList projects;
  final ImmutableList<RexNode> filters;
  if (scan instanceof Bindables.BindableTableScan) {
   final Bindables.BindableTableScan bindableScan =
     (Bindables.BindableTableScan) scan;
   filters = bindableScan.filters;
   projects = bindableScan.projects;
  } else {
   filters = ImmutableList.of();
   projects = scan.identity();
  }

  final List<Integer> projects2 =
    Mappings.apply((Mapping) mapping, projects);
  call.transformTo(
    Bindables.BindableTableScan.create(scan.getCluster(), scan.getTable(),
      filters, projects2));
 }
}

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

protected void apply(RelOptRuleCall call, Project project, TableScan scan) {
  final RelOptTable table = scan.getTable();
  assert table.unwrap(ProjectableFilterableTable.class) != null;

  final Mappings.TargetMapping mapping = project.getMapping();
  if (mapping == null
    || Mappings.isIdentity(mapping)) {
   return;
  }

  final ImmutableIntList projects;
  final ImmutableList<RexNode> filters;
  if (scan instanceof Bindables.BindableTableScan) {
   final Bindables.BindableTableScan bindableScan =
     (Bindables.BindableTableScan) scan;
   filters = bindableScan.filters;
   projects = bindableScan.projects;
  } else {
   filters = ImmutableList.of();
   projects = scan.identity();
  }

  final List<Integer> projects2 =
    Mappings.apply((Mapping) mapping, projects);
  call.transformTo(
    Bindables.BindableTableScan.create(scan.getCluster(), scan.getTable(),
      filters, projects2));
 }
}

相关文章