How to create a DLT pipeline with SQL statement

guangyi
Contributor III

I need a DLT pipeline to create a materialized view for fetching event logs. All the ways below I tried are failed:

  • Attach a notebook with pure SQL inside: No magic cell like `%sql` are failed
  • Attach a notebook with `spark.sql` python code: Failed because I cannot use the `CREATE VIEW` statement.
  • Attach a file with `.sql` format: Failed because sql format is not supported yet.

I follow the instructions here to query event log: https://docs.databricks.com/en/delta-live-tables/observability.html#monitor-delta-live-tables-pipeli...

How can I achieve this with the DLT pipeline?