A way to do it would be to allow to define an "expression" key in the column definition to override the automatic generation of the column_expression in dbt_external_tables/macros/plugins/snowflake/create_external_table.sql.
This seems less robust than what's done on snowpipe, but in this case we may want to stay flexible as the call to the metadata may depend on the source of the external table.
Additional context
This feature would be Snowflake specific
Who will this benefit?
This would allow us to specify sql code to load some columns directly using user-defined expressions.
example: Accessing metadata from the file, or whichever expression the user needs.
Describe the feature
Hello there, I've been looking for a way to expose
metadata$file_last_modified
on Snowflake (to load files from GCS buckets). I came across this MR https://github.com/dbt-labs/dbt-external-tables/pull/239 for snowpipe. I'd like to do it for auto-refreshed external tables, without snowpipe.Describe alternatives you've considered
A way to do it would be to allow to define an
"expression"
key in the column definition to override the automatic generation of the column_expression indbt_external_tables/macros/plugins/snowflake/create_external_table.sql
. This seems less robust than what's done on snowpipe, but in this case we may want to stay flexible as the call to the metadata may depend on the source of the external table.Additional context
This feature would be Snowflake specific
Who will this benefit?
This would allow us to specify sql code to load some columns directly using user-defined expressions.
example: Accessing
metadata
from the file, or whichever expression the user needs.