public class MaterializationService extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MaterializationService.DefaultTableFactory
Default implementation of
MaterializationService.TableFactory. |
static interface |
MaterializationService.TableFactory
Creates tables that represent a materialized view.
|
| Modifier and Type | Method and Description |
|---|---|
CalciteSchema.TableEntry |
checkValid(MaterializationKey key)
Checks whether a materialization is valid, and if so, returns the table
where the data are stored.
|
void |
clear()
De-registers all materialized tables in the system.
|
@Nullable MaterializationKey |
defineMaterialization(CalciteSchema schema,
@Nullable TileKey tileKey,
String viewSql,
@Nullable List<String> viewSchemaPath,
@Nullable String suggestedTableName,
boolean create,
boolean existing)
Defines a new materialization.
|
@Nullable MaterializationKey |
defineMaterialization(CalciteSchema schema,
@Nullable TileKey tileKey,
String viewSql,
@Nullable List<String> viewSchemaPath,
@Nullable String suggestedTableName,
MaterializationService.TableFactory tableFactory,
boolean create,
boolean existing)
Defines a new materialization.
|
@Nullable Pair<CalciteSchema.TableEntry,TileKey> |
defineTile(Lattice lattice,
ImmutableBitSet groupSet,
List<Lattice.Measure> measureList,
CalciteSchema schema,
boolean create,
boolean exact)
Defines a tile.
|
@Nullable Pair<CalciteSchema.TableEntry,TileKey> |
defineTile(Lattice lattice,
ImmutableBitSet groupSet,
List<Lattice.Measure> measureList,
CalciteSchema schema,
boolean create,
boolean exact,
String suggestedTableName,
MaterializationService.TableFactory tableFactory) |
static MaterializationService |
instance()
Returns the instance of the materialization service.
|
List<Prepare.Materialization> |
query(CalciteSchema rootSchema)
Gathers a list of all materialized tables known within a given root
schema.
|
void |
removeMaterialization(MaterializationKey key) |
static void |
setThreadLocal()
Used by tests, to ensure that they see their own service.
|
public @Nullable MaterializationKey defineMaterialization(CalciteSchema schema, @Nullable TileKey tileKey, String viewSql, @Nullable List<String> viewSchemaPath, @Nullable String suggestedTableName, boolean create, boolean existing)
public @Nullable MaterializationKey defineMaterialization(CalciteSchema schema, @Nullable TileKey tileKey, String viewSql, @Nullable List<String> viewSchemaPath, @Nullable String suggestedTableName, MaterializationService.TableFactory tableFactory, boolean create, boolean existing)
public CalciteSchema.TableEntry checkValid(MaterializationKey key)
public @Nullable Pair<CalciteSchema.TableEntry,TileKey> defineTile(Lattice lattice, ImmutableBitSet groupSet, List<Lattice.Measure> measureList, CalciteSchema schema, boolean create, boolean exact)
Setting the create flag to false prevents a materialization
from being created if one does not exist. Critically, it is set to false
during the recursive SQL that populates a materialization. Otherwise a
materialization would try to create itself to populate itself!
public @Nullable Pair<CalciteSchema.TableEntry,TileKey> defineTile(Lattice lattice, ImmutableBitSet groupSet, List<Lattice.Measure> measureList, CalciteSchema schema, boolean create, boolean exact, String suggestedTableName, MaterializationService.TableFactory tableFactory)
public List<Prepare.Materialization> query(CalciteSchema rootSchema)
public void clear()
public static void setThreadLocal()
public static MaterializationService instance()
setThreadLocal() has been called by the current thread).public void removeMaterialization(MaterializationKey key)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.