cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

read_files to create streaming table using Databricks SQL

DB3
New Contributor II

I follow the same syntax from documentation for create streaming table and it was last week and not working now

Ex query:CREATE OR REFRESH STREAMING TABLE
`ax`.`db`.`healthex`
AS SELECT * FROM STREAM
read_files(
"/Volumes/ax/db/dlt-test/", -- The file path
format=>'csv',header=>true,delimiter=>'|')                       

 

Whats wrong here

2 REPLIES 2

mary598chess
Visitor

@DB3 wrote:

I follow the same syntax from documentation for create streaming table and it was last week and not working now

Ex query:CREATE OR REFRESH STREAMING TABLE
`ax`.`db`.`healthex`
AS SELECT * FROM STREAM
read_files(
"/Volumes/ax/db/dlt-test/", -- The file path
format=>'csv',header=>true,delimiter=>'|')                       

 

Whats wrong here


Hello,
It looks like there's a syntax issue in your CREATE OR REFRESH STREAMING TABLE statement. The correct syntax should be:
CREATE OR REFRESH STREAMING TABLE `ax`.`db`.`healthex`
AS SELECT * FROM read_files("/Volumes/ax/db/dlt-test/", -- The file path
format=>'csv',header=>true,delimiter=>'|')

Make sure there's no space between CREATE OR REFRESH and STREAMING TABLE. Does this help?

Best Regards,
Mary Chess

DB3
New Contributor II

I followed the syntax in this documentation link https://docs.databricks.com/en/tables/streaming.html

I get this error if the STREAM keyword is excluded 

Please add the STREAM keyword to your FROM clause to turn this relation into a streaming query. SQLSTATE: 42000

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group