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


Java CalciteSchema.LatticeEntry方法代码示例

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


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

示例1: populateMaterializationsAndLattice

import org.apache.calcite.jdbc.CalciteSchema; //导入方法依赖的package包/类
private void populateMaterializationsAndLattice(
    QuarkMaterializeCluster.RelOptPlannerHolder plannerHolder,
    CalciteSchema rootSchema) {
  if (materializations == null) {
    materializations =
        MaterializationService.instance().query(rootSchema);
  }
  Materializer materializer = new Materializer(materializations);

  materializer.populateMaterializations(context.getPrepareContext(), plannerHolder);

  List<CalciteSchema.LatticeEntry> lattices = Schemas.getLatticeEntries(rootSchema);

  for (CalciteSchema.LatticeEntry lattice : lattices) {
    final CalciteSchema.TableEntry starTable = lattice.getStarTable();
    final JavaTypeFactory typeFactory = context.getTypeFactory();
    final RelOptTableImpl starRelOptTable =
        RelOptTableImpl.create(catalogReader,
            starTable.getTable().getRowType(typeFactory), starTable, null);
    plannerHolder.getPlanner().addLattice(
        new RelOptLattice(lattice.getLattice(), starRelOptTable));
  }
}
 
开发者ID:qubole,项目名称:quark,代码行数:24,代码来源:SqlWorker.java

示例2: init

import org.apache.calcite.jdbc.CalciteSchema; //导入方法依赖的package包/类
/**
 * Called after the constructor has completed and the model has been
 * loaded.
 */
void init() {
    final MaterializationService service = MaterializationService.instance();
    for (CalciteSchema.LatticeEntry e : Schemas.getLatticeEntries(rootSchema)) {
        final Lattice lattice = e.getLattice();
        for (Lattice.Tile tile : lattice.computeTiles()) {
            service.defineTile(lattice, tile.bitSet(), tile.measures, e.schema,
                    true, true);
        }
    }
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:15,代码来源:CalciteConnectionImpl.java

示例3: getLatticeEntries

import org.apache.calcite.jdbc.CalciteSchema; //导入方法依赖的package包/类
/** Returns the lattices defined in a schema.
 *
 * @param schema Schema */
public static List<CalciteSchema.LatticeEntry> getLatticeEntries(
    CalciteSchema schema) {
  final List<CalciteSchema.LatticeEntry> list = Lists.newArrayList();
  gatherLattices(schema, list);
  return list;
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:Schemas.java

示例4: gatherLattices

import org.apache.calcite.jdbc.CalciteSchema; //导入方法依赖的package包/类
private static void gatherLattices(CalciteSchema schema,
    List<CalciteSchema.LatticeEntry> list) {
  list.addAll(schema.getLatticeMap().values());
  for (CalciteSchema subSchema : schema.getSubSchemaMap().values()) {
    gatherLattices(subSchema, list);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:Schemas.java

示例5: prepare_

import org.apache.calcite.jdbc.CalciteSchema; //导入方法依赖的package包/类
private PreparedResult prepare_(Supplier<RelNode> fn,
    RelDataType resultType) {
  Class runtimeContextClass = Object.class;
  init(runtimeContextClass);

  final RelNode rel = fn.get();
  final RelDataType rowType = rel.getRowType();
  final List<Pair<Integer, String>> fields =
      Pair.zip(ImmutableIntList.identity(rowType.getFieldCount()),
          rowType.getFieldNames());
  final RelCollation collation =
      rel instanceof Sort
          ? ((Sort) rel).collation
          : RelCollations.EMPTY;
  RelRoot root = new RelRoot(rel, resultType, SqlKind.SELECT, fields,
      collation);

  if (timingTracer != null) {
    timingTracer.traceTime("end sql2rel");
  }

  final RelDataType jdbcType =
      makeStruct(rexBuilder.getTypeFactory(), resultType);
  fieldOrigins = Collections.nCopies(jdbcType.getFieldCount(), null);
  parameterRowType = rexBuilder.getTypeFactory().builder().build();

  // Structured type flattening, view expansion, and plugging in
  // physical storage.
  root = root.withRel(flattenTypes(root.rel, true));

  // Trim unused fields.
  root = trimUnusedFields(root);

  final List<Materialization> materializations = ImmutableList.of();
  final List<CalciteSchema.LatticeEntry> lattices = ImmutableList.of();
  root = optimize(root, materializations, lattices);

  if (timingTracer != null) {
    timingTracer.traceTime("end optimization");
  }

  return implement(root);
}
 
开发者ID:apache,项目名称:calcite,代码行数:44,代码来源:CalcitePrepareImpl.java

示例6: getStarTables

import org.apache.calcite.jdbc.CalciteSchema; //导入方法依赖的package包/类
/** Returns the star tables defined in a schema.
 *
 * @param schema Schema */
public static List<CalciteSchema.TableEntry> getStarTables(
    CalciteSchema schema) {
  final List<CalciteSchema.LatticeEntry> list = getLatticeEntries(schema);
  return Lists.transform(list, TO_TABLE_ENTRY);
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:Schemas.java

示例7: getLattices

import org.apache.calcite.jdbc.CalciteSchema; //导入方法依赖的package包/类
/** Returns the lattices defined in a schema.
 *
 * @param schema Schema */
public static List<Lattice> getLattices(CalciteSchema schema) {
  final List<CalciteSchema.LatticeEntry> list = getLatticeEntries(schema);
  return Lists.transform(list, TO_LATTICE);
}
 
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:Schemas.java


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