The Virtual System Dictionary (VSD) allows seamlessly browsing Block File System (BFS), Object File System (OFS), and Open Table Format (OTF) objects.
The VSD uses DBC dictionary views, such as DBC.DatabaseV[X], DBC.TablesV[X], and DBC.ColumnsV[X] for BFS or OFS objects and it uses OTF table operator for Datalake objects.
Syntax
SELECT <selectivity-list> FROM VSD_<query object> WHERE <predicate>
The syntax queries the appropriate DBC view if the object is a BFS or OFS table or uses OTF table operator to collect information if the object is an OTF table for each qualifying catalog selected by the conditions on CatalogName.
The VSD returns catalog (Datalake), database, table and column information.
How the Syntax Works
The <predicate> determines if the query uses the table operator, the DBC view or both to identify the dictionary information. If the <predicate>:
- Contains CatalogName, then the query uses OTF table operator to collect the metadata information from the qualifying catalogs.
- Specifies CatalogName as NULL or TD_LOCAL, then the query runs using the corresponding DBC dictionary view. For example, ColumnsV, ColumnsVX, TablesV, TablesVX, DatabasesV, and so on. We will also add the new columns to the SELECT LIST at runtime so that it looks like:
SELECT CAST ('TD_LOCAL' as varchar(128))CatalogName, DBC.DatabasesV, ... - Specifies CatalogName is not specified, then the query uses the DBC dictionary view and merge the OTF table operator and the results.This option queries all the defined Datalakes in TD_SERVER_DB and can be a resource and time-consuming query.