referenced_tables
referenced_tables
counts the number of tables/views that are referenced by the query that match the entries present in the specified pinned table.
- See also:
- ALTER SUNDECK TABLE,
REFERENCED_TABLES(<pin table identifier>, <db column name>, <schema column name>, <table column name>) <ComparisionOperator> <count>
<pin table identifier>
- Identifier of pin table.
<db column name>
- Column name of database name in pin table.
<schema column name>
- Column name of schema name in pin table.
<table column name>
- Column name of table name in pin table.
<ComparisionOperator>
- One of Snowflake comparision opearator ComparisionOperator.
<count>
- Count to match against
TRUE
- If count comparison is successful with number of tables/views that are referenced by the query that match the entries present in the specified pinned table.
FALSE
- If count comparison is unsuccessful with number of tables/views that are referenced by the query that match the entries present in the specified pinned table.
Sf Pin Table: MYDB.PINTABLE.LARGE_TABLE_LIST
DB_NAME | SCHEMA_NAME | TABLE_NAME |
---|---|---|
SNOWFLAKE_SAMPLE_DATA | TPCH_SF1 | ORDERS |
SNOWFLAKE_SAMPLE_DATA | TPCH_SF1 | LINEITEM |
REFERENCED_TABLES(MYDB.PINTABLE.LARGE_TABLE_LIST, 'DB_NAME', 'SCHEMA_NAME', 'TABLE_NAME') > 1
sql | Result | COMMENT |
---|---|---|
select count(*) from SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.ORDERS,SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.LINEITEM | TRUE | Two different tables referred |
select count(*) from SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.LINEITEM,SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.LINEITEM | TRUE | Two same tables referred |
select count(*) from SNOWFLAKE_SAMPLE_DATA.TPCH_SF1.LINEITEM | FALSE | One table referred |