Class JsonLattice
Occurs within JsonSchema.lattices
.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionfinal boolean
Whether to use an optimization algorithm to suggest and populate an initial set of tiles.final long
Maximum time (in milliseconds) to run the algorithm.final boolean
Whether to materialize tiles on demand as queries are executed.final List<JsonMeasure>
List of measures that a tile should have by default.final String
The name of this lattice.final @Nullable Double
Estimated number of rows.final Object
SQL query that defines the lattice.final @Nullable String
Name of a class that provides estimates of the number of distinct values in each column.List of materialized aggregates to create up front. -
Constructor Summary
ConstructorDescriptionJsonLattice
(String name, Object sql, @Nullable Boolean auto, @Nullable Boolean algorithm, @Nullable Long algorithmMaxMillis, @Nullable Double rowCountEstimate, @Nullable String statisticProvider, @Nullable List<JsonMeasure> defaultMeasures) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(ModelHandler handler) getSql()
Returns the SQL query as a string, concatenating a list of lines if necessary.toString()
void
visitChildren
(ModelHandler modelHandler)
-
Field Details
-
name
The name of this lattice.Required.
-
sql
SQL query that defines the lattice.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.
-
auto
public final boolean autoWhether to materialize tiles on demand as queries are executed.Optional; default is true.
-
algorithm
public final boolean algorithmWhether to use an optimization algorithm to suggest and populate an initial set of tiles.Optional; default is false.
-
algorithmMaxMillis
public final long algorithmMaxMillisMaximum time (in milliseconds) to run the algorithm.Optional; default is -1, meaning no timeout.
When the timeout is reached, Calcite uses the best result that has been obtained so far.
-
rowCountEstimate
Estimated number of rows.If null, Calcite will a query to find the real value.
-
statisticProvider
Name of a class that provides estimates of the number of distinct values in each column.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.
-
tiles
List of materialized aggregates to create up front. -
defaultMeasures
List of measures that a tile should have by default.A tile can define its own measures, including measures not in this list.
Optional. The default list is just "count(*)".
-
-
Constructor Details
-
JsonLattice
-
-
Method Details