Pipelines are expected to have at least one table Error While running DLT pipeline
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2025 09:03 AM
Error :Pipelines are expected to have at least one table defined but
no tables were found in your pipeline
I wrote simple code as phase 1 debug
%sql CREATE OR REFRESH STREAMING TABLE test_table AS SELECT "hello" as greeting;
Can u plz help what's wrong in this code ?
Pricing Tier : Premium (+ Role-based access controls) (Click to change)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2025 10:21 AM
In Delta Live Tables (DLT), magic commands (such as %sql) are not used. In a DLT pipeline, you need to write SQL code directly. Please try removing %sql and running the DLT pipeline again.
Takuya Omi (尾美拓哉)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2025 12:35 AM
Hey @vignesh22 - Adding to what @Takuya-Omi san has mentioned - the instantiation of streaming table in your definition is incorrect. You're trying to create a stream table using a batch source which will result in the DLT Analysis Exception as described below.
com.databricks.pipelines.common.errors.DLTAnalysisException: Creating a streaming table from a batch query prevents incremental loading of new data from source. Offending table: 'dev.default.test_table'.
Please use the stream() operator. Example usage:
CREATE STREAMING TABLE <target table name> ... AS SELECT ... FROM stream(<source table name>) ...If you're only trying to test the functionality of DLT, may be create a materialized view rather than the streaming table.
https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-materialized-view
Let me know if any questions! Cheers!