本文整理汇总了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));
}
}
示例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);
}
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}