Class TableInfo
java.lang.Object
io.trino.spi.eventlistener.TableInfo
This class is JSON serializable for convenience and serialization compatibility is not guaranteed across versions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the reference chain for this table.getTable()If this object refers to a view or materialized view, return the SQL text of the view.boolean
-
Constructor Details
-
TableInfo
-
-
Method Details
-
getCatalog
-
getSchema
-
getTable
-
getAuthorization
-
getFilters
-
getColumns
-
isDirectlyReferenced
public boolean isDirectlyReferenced() -
getViewText
-
getReferenceChain
Get the reference chain for this table. Contains entries for view-like expressions such as views, column masks, and row filters. Note that in contrast togetFilters()andgetColumns(), this has information about the reference chain leading this table to be included in the query, rather than information about which filters/masks were applied to this table scan.Let us assume the following setup, with default catalog "default" and default schema "db":
CREATE TABLE t_base (a INT, b INT); CREATE VIEW v1 AS SELECT * FROM t_base; CREATE VIEW v2 AS SELECT * FROM v1; Row filter for t_base: a NOT IN (SELECT * FROM t_filter) Column mask for t_base.b: IF(b IN (SELECT * FROM t_mask), b, NULL)
If we executeSELECT * FROM v2, we will see the following values forreferenceChain:v2 -> [] v1 -> [{"view", "default", "db", "v2"}] t_base -> [{"view", "default", "db", "v2"}, {"view", "default", "db", "v1"}] t_filter -> [{"view", "default", "db", "v2"}, {"view", "default", "db", "v1"}, {"rowFilter", "a NOT IN (SELECT * FROM t_filter)", "default", "db", "t_base"}] t_mask -> [{"view", "default", "db", "v2"}, {"view", "default", "db", "v1"}, {"columnMask", "IF(b IN SELECT * FROM t_mask, b, NULL)", "default", "db", "t_base"}]- Returns:
- The reference chain leading to this table, in order.
-