create flow for streaming table
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 03:49 AM
Hi Team.
I'm following the example code to create flows, which is here.
When I create the streaming table without a query (see code below):
CREATE OR REFRESH STREAMING TABLE target_table;
I get the error "The operation CREATE WITHOUT A QUERY is not allowed: The operation is not supported on Streaming Tables.".
Does anyone know what I am doing wrong?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 06:56 AM
The error "The operation CREATE WITHOUT A QUERY is not allowed: The operation is not supported on Streaming Tables" occurs because the
CREATE OR REFRESH STREAMING TABLE statement requires a query to define the data source for the streaming table. Streaming tables necessitate a query that specifies how their data is populated, rather than being created without a query specification.Here are the key points related to this issue:
-
Streaming tables are designed for handling incremental or streaming data processing. The
CREATE STREAMING TABLEcommand must include anAS queryclause that provides a streaming query to process and populate the table. Omitting the query is not supported. -
The
CREATE OR REFRESH STREAMING TABLEstatement is valid for refreshing existing streaming tables with new data from the defined query, but still requires the query to be specified during creation. -
For initialization, examples of valid syntax include:
sql CREATE OR REFRESH STREAMING TABLE example_table AS SELECT * FROM STREAM read_files('<path_to_file>', '<options>');This type of statement specifies the data source and streaming query configuration. -
If you simply want to refresh an existing table, use the
REFRESH STREAMING TABLE <table_name>command or explicitly define it with a query for a full refresh.
You need to revise your statement to include a streaming query when creating the table. Let me know if you'd like help constructing it!
DLT uses a simple declaritive language when using SQL. In short, it is essentially a CTAS statement like you would use in SQL. Check out our documenation.
Hope this helps. Lou.