| Constructor and Description |
|---|
Builder(org.apache.calcite.materialize.LatticeSpace space,
CalciteSchema schema,
String sql) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addMeasure(Lattice.Measure measure)
Adds a measure, if it does not already exist.
|
void |
addTile(Lattice.Tile tile) |
Lattice.Builder |
algorithm(boolean algorithm)
Sets the "algorithm" attribute (default false).
|
Lattice.Builder |
algorithmMaxMillis(long algorithmMaxMillis)
Sets the "algorithmMaxMillis" attribute (default -1).
|
Lattice.Builder |
auto(boolean auto)
Sets the "auto" attribute (default true).
|
Lattice |
build()
Builds a lattice.
|
Lattice.Column |
column(int table,
int column) |
Lattice.Column |
expression(RexNode e,
String alias,
List<String> tableAliases)
Adds a lattice column based on a SQL expression,
or returns a column based on the same expression seen previously.
|
com.google.common.collect.ImmutableList<Lattice.Column> |
resolveArgs(Object args)
Resolves the arguments of a
JsonMeasure. |
Lattice.Column |
resolveColumn(Object name) |
Lattice.Measure |
resolveMeasure(String aggName,
boolean distinct,
Object args) |
Lattice.Builder |
rowCountEstimate(double rowCountEstimate)
Sets the "rowCountEstimate" attribute (default null).
|
Lattice.Builder |
statisticProvider(String statisticProvider)
Sets the "statisticProvider" attribute.
|
void |
use(Lattice.Column column,
boolean measure)
Records a use of a column.
|
public Builder(org.apache.calcite.materialize.LatticeSpace space,
CalciteSchema schema,
String sql)
public Lattice.Builder auto(boolean auto)
public Lattice.Builder algorithm(boolean algorithm)
public Lattice.Builder algorithmMaxMillis(long algorithmMaxMillis)
public Lattice.Builder rowCountEstimate(double rowCountEstimate)
public Lattice.Builder statisticProvider(String statisticProvider)
If not set, the lattice will use Lattices.CACHED_SQL.
public Lattice build()
public com.google.common.collect.ImmutableList<Lattice.Column> resolveArgs(@Nullable Object args)
JsonMeasure. They must either be null,
a string, or a list of strings. Throws if the structure is invalid, or if
any of the columns do not exist in the lattice.public Lattice.Column resolveColumn(Object name)
public Lattice.Measure resolveMeasure(String aggName, boolean distinct, @Nullable Object args)
public boolean addMeasure(Lattice.Measure measure)
public void addTile(Lattice.Tile tile)
public Lattice.Column column(int table, int column)
public Lattice.Column expression(RexNode e, String alias, List<String> tableAliases)
public void use(Lattice.Column column, boolean measure)
column - Columnmeasure - Whether this use is as an argument to a measure;
e.g. "sum(x + y)" is a measure use of the expression
"x + y"; "group by x + y" is notCopyright © 2012-2020 Apache Software Foundation. All Rights Reserved.