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
New Contributor II

@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

 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now