Package org.apache.calcite.materialize
Class Lattice.Builder
java.lang.Object
org.apache.calcite.materialize.Lattice.Builder
- Enclosing class:
Lattice
Lattice builder.
-
Constructor Summary
ConstructorDescriptionBuilder
(org.apache.calcite.materialize.LatticeSpace space, CalciteSchema schema, String sql) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addMeasure
(Lattice.Measure measure) Adds a measure, if it does not already exist.void
addTile
(Lattice.Tile tile) algorithm
(boolean algorithm) Sets the "algorithm" attribute (default false).algorithmMaxMillis
(long algorithmMaxMillis) Sets the "algorithmMaxMillis" attribute (default -1).auto
(boolean auto) Sets the "auto" attribute (default true).build()
Builds a lattice.column
(int table, int 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
(@Nullable Object args) Resolves the arguments of aJsonMeasure
.resolveColumn
(Object name) resolveMeasure
(String aggName, boolean distinct, @Nullable Object args) rowCountEstimate
(double rowCountEstimate) Sets the "rowCountEstimate" attribute (default null).statisticProvider
(@Nullable String statisticProvider) Sets the "statisticProvider" attribute.void
use
(Lattice.Column column, boolean measure) Records a use of a column.
-
Constructor Details
-
Builder
-
-
Method Details
-
auto
Sets the "auto" attribute (default true). -
algorithm
Sets the "algorithm" attribute (default false). -
algorithmMaxMillis
Sets the "algorithmMaxMillis" attribute (default -1). -
rowCountEstimate
Sets the "rowCountEstimate" attribute (default null). -
statisticProvider
Sets the "statisticProvider" attribute.If not set, the lattice will use
Lattices.CACHED_SQL
. -
build
Builds a lattice. -
resolveArgs
Resolves the arguments of aJsonMeasure
. 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. -
resolveColumn
-
resolveMeasure
-
addMeasure
Adds a measure, if it does not already exist. Returns false if an identical measure already exists. -
addTile
-
column
-
expression
Adds a lattice column based on a SQL expression, or returns a column based on the same expression seen previously. -
use
Records a use of a column.- Parameters:
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 not
-