public class JsonLattice extends Object
Occurs within JsonSchema.lattices.
Description of schema elements| Modifier and Type | Field and Description |
|---|---|
boolean |
algorithm
Whether to use an optimization algorithm to suggest and populate an
initial set of tiles.
|
long |
algorithmMaxMillis
Maximum time (in milliseconds) to run the algorithm.
|
boolean |
auto
Whether to materialize tiles on demand as queries are executed.
|
List<JsonMeasure> |
defaultMeasures
List of measures that a tile should have by default.
|
String |
name
The name of this lattice.
|
@Nullable Double |
rowCountEstimate
Estimated number of rows.
|
Object |
sql
SQL query that defines the lattice.
|
@Nullable String |
statisticProvider
Name of a class that provides estimates of the number of distinct values
in each column.
|
List<JsonTile> |
tiles
List of materialized aggregates to create up front.
|
| Constructor and Description |
|---|
JsonLattice(String name,
Object sql,
@Nullable Boolean auto,
@Nullable Boolean algorithm,
@Nullable Long algorithmMaxMillis,
@Nullable Double rowCountEstimate,
@Nullable String statisticProvider,
@Nullable List<JsonMeasure> defaultMeasures) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ModelHandler handler) |
String |
getSql()
Returns the SQL query as a string, concatenating a list of lines if
necessary.
|
String |
toString() |
void |
visitChildren(ModelHandler modelHandler) |
public final String name
Required.
public final Object sql
Must be a string or a list of strings (which are concatenated into a multi-line SQL string, separated by newlines).
The structure of the SQL statement, and in particular the order of items in the FROM clause, defines the fact table, dimension tables, and join paths for this lattice.
public final boolean auto
Optional; default is true.
public final boolean algorithm
Optional; default is false.
public final long algorithmMaxMillis
Optional; default is -1, meaning no timeout.
When the timeout is reached, Calcite uses the best result that has been obtained so far.
public final @Nullable Double rowCountEstimate
If null, Calcite will a query to find the real value.
public final @Nullable String statisticProvider
The class must implement the
LatticeStatisticProvider interface.
Or, you can use a class name plus a static field, for example "org.apache.calcite.materialize.Lattices#CACHING_SQL_STATISTIC_PROVIDER".
If not set, Calcite will generate and execute a SQL query to find the real value, and cache the results.
public final List<JsonMeasure> defaultMeasures
A tile can define its own measures, including measures not in this list.
Optional. The default list is just "count(*)".
public void accept(ModelHandler handler)
public String getSql()
public void visitChildren(ModelHandler modelHandler)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.