public class Lattice extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Lattice.Builder
Lattice builder.
|
static class |
Lattice.Column
Column in a lattice.
|
private static class |
Lattice.Edge
Edge in the temporary graph.
|
static class |
Lattice.Measure
Measure in a lattice.
|
static class |
Lattice.Node
Source relation of a lattice.
|
static class |
Lattice.Tile
Materialized aggregate within a lattice.
|
static class |
Lattice.TileBuilder
Tile builder.
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
algorithm |
long |
algorithmMaxMillis |
boolean |
auto |
com.google.common.collect.ImmutableList<Lattice.Column> |
columns |
com.google.common.collect.ImmutableList<Lattice.Measure> |
defaultMeasures |
private static com.google.common.base.Function<Lattice.Column,String> |
GET_ALIAS |
private static com.google.common.base.Function<Lattice.Column,Integer> |
GET_ORDINAL |
com.google.common.collect.ImmutableList<Lattice.Node> |
nodes |
CalciteSchema |
rootSchema |
double |
rowCountEstimate |
LatticeStatisticProvider |
statisticProvider |
com.google.common.collect.ImmutableList<Lattice.Tile> |
tiles |
private com.google.common.base.Function<Integer,Lattice.Column> |
toColumnFunction |
private com.google.common.base.Function<AggregateCall,Lattice.Measure> |
toMeasureFunction |
com.google.common.collect.ImmutableList<String> |
uniqueColumnNames |
| Modifier | Constructor and Description |
|---|---|
private |
Lattice(CalciteSchema rootSchema,
com.google.common.collect.ImmutableList<Lattice.Node> nodes,
boolean auto,
boolean algorithm,
long algorithmMaxMillis,
LatticeStatisticProvider.Factory statisticProviderFactory,
Double rowCountEstimate,
com.google.common.collect.ImmutableList<Lattice.Column> columns,
com.google.common.collect.ImmutableList<Lattice.Measure> defaultMeasures,
com.google.common.collect.ImmutableList<Lattice.Tile> tiles) |
| Modifier and Type | Method and Description |
|---|---|
static Lattice.Builder |
builder(CalciteSchema calciteSchema,
String sql) |
Iterable<? extends Lattice.Tile> |
computeTiles() |
String |
countSql(ImmutableBitSet groupSet)
Returns a SQL query that counts the number of distinct values of the
attributes given in
groupSet. |
static Lattice |
create(CalciteSchema schema,
String sql,
boolean auto)
Creates a Lattice.
|
StarTable |
createStarTable() |
double |
getFactRowCount()
Returns an estimate of the number of rows in the un-aggregated star.
|
static double |
getRowCount(double factCount,
double... columnCounts)
Returns an estimate of the number of rows in the tile with the given
dimensions.
|
static double |
getRowCount(double factCount,
List<Double> columnCounts)
Returns an estimate of the number of rows in the tile with the given
dimensions.
|
double |
getRowCount(List<Lattice.Column> columns)
Returns an estimate of the number of rows in the tile with the given
dimensions.
|
private static int[][] |
grab(List<RelNode> leaves,
RexNode rex)
Converts an "t1.c1 = t2.c2" expression into two (input, field) pairs.
|
private static int[] |
inputField(List<RelNode> leaves,
RexNode rex)
Converts an expression into an (input, field) pair.
|
private static boolean |
populate(List<RelNode> nodes,
List<int[][]> tempLinks,
RelNode rel) |
private static void |
populateAliases(SqlNode from,
List<String> aliases,
String current) |
String |
sql(ImmutableBitSet groupSet,
boolean group,
List<Lattice.Measure> aggCallList)
Generates a SQL query to populate a tile of the lattice specified by a
given set of columns and measures, optionally grouping.
|
String |
sql(ImmutableBitSet groupSet,
List<Lattice.Measure> aggCallList)
Generates a SQL query to populate a tile of the lattice specified by a
given set of columns and measures.
|
List<Lattice.Measure> |
toMeasures(List<AggregateCall> aggCallList) |
private static void |
use(List<Lattice.Node> usedNodes,
Lattice.Node node) |
private static final com.google.common.base.Function<Lattice.Column,String> GET_ALIAS
private static final com.google.common.base.Function<Lattice.Column,Integer> GET_ORDINAL
public final CalciteSchema rootSchema
public final com.google.common.collect.ImmutableList<Lattice.Node> nodes
public final com.google.common.collect.ImmutableList<Lattice.Column> columns
public final boolean auto
public final boolean algorithm
public final long algorithmMaxMillis
public final double rowCountEstimate
public final com.google.common.collect.ImmutableList<Lattice.Measure> defaultMeasures
public final com.google.common.collect.ImmutableList<Lattice.Tile> tiles
public final com.google.common.collect.ImmutableList<String> uniqueColumnNames
public final LatticeStatisticProvider statisticProvider
private final com.google.common.base.Function<Integer,Lattice.Column> toColumnFunction
private final com.google.common.base.Function<AggregateCall,Lattice.Measure> toMeasureFunction
private Lattice(CalciteSchema rootSchema, com.google.common.collect.ImmutableList<Lattice.Node> nodes, boolean auto, boolean algorithm, long algorithmMaxMillis, LatticeStatisticProvider.Factory statisticProviderFactory, Double rowCountEstimate, com.google.common.collect.ImmutableList<Lattice.Column> columns, com.google.common.collect.ImmutableList<Lattice.Measure> defaultMeasures, com.google.common.collect.ImmutableList<Lattice.Tile> tiles)
public static Lattice create(CalciteSchema schema, String sql, boolean auto)
private static void populateAliases(SqlNode from, List<String> aliases, String current)
private static int[][] grab(List<RelNode> leaves, RexNode rex)
private static int[] inputField(List<RelNode> leaves, RexNode rex)
public String sql(ImmutableBitSet groupSet, List<Lattice.Measure> aggCallList)
public String sql(ImmutableBitSet groupSet, boolean group, List<Lattice.Measure> aggCallList)
public String countSql(ImmutableBitSet groupSet)
groupSet.private static void use(List<Lattice.Node> usedNodes, Lattice.Node node)
public StarTable createStarTable()
public static Lattice.Builder builder(CalciteSchema calciteSchema, String sql)
public List<Lattice.Measure> toMeasures(List<AggregateCall> aggCallList)
public Iterable<? extends Lattice.Tile> computeTiles()
public double getFactRowCount()
public double getRowCount(List<Lattice.Column> columns)
public static double getRowCount(double factCount,
double... columnCounts)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.