I am trying to return column: cluster_by
using a snowflake query as below with a dbt
macro.
The macro will be used to infer if a model (and correct target relation) has a clustering property.
I have this code as a start, and tried reading snowflake documentation but their docs are for snowflake tables as sources, not a show tables
command
DECLARE
res RESULTSET DEFAULT (execute immediate 'show tables like ''obj_name''');
BEGIN
return table(res);
END
Currently it returns the entire table, how do I change this so that I only return column cluster_by
expected result:
| cluster_by |
| ——– |
| column |
Have looked at result_set documentation on Snowflake but their documentation is for tables rather than a result set from the show tables...
command
Phil Baines is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.