fabrice-etanchaud/dbt-dremio

implement external queries

Closed this issue · 0 comments

just implemented external queries, will be available in next release :

https://docs.dremio.com/software/data-sources/external-queries/

That's the way to push a query in native sql on an external source.

How to use it :

  • add a new config : +external_query: true
  • the SQL must not contain any ref() or source(), only [schema.]table paths
  • add at least one -- depends_on : {{ source(my_source, my_table) }} (no ref() !!). To let source table dependencies show up in the auto generated documentation, one should mention all the source tables used in the external query.

dbt will use the common {{ source(my_source, my_table).include(schema=false, identifier=false }} to build the external query call :

select *
from table(source_name.external_query('sql'))

This only works for view, table and incremental materializations.