cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Azure data bricks delta tables .Issue

RohitKulkarni
Contributor

Hello Team,

I have written Spark SQL Query in data bricks :

DROP TABLE IF EXISTS Salesforce.Location;

CREATE EXTERNAL TABLE Salesforce.Location (

Id STRING,

OwnerId STRING,

IsDeleted bigint,

Name STRING,

CurrencyIsoCode STRING,

CreatedDate bigint,

CreatedById STRING,

LastModifiedDate bigint,

LastModifiedById STRING,

SystemModstamp bigint,

LocationType STRING,

Description STRING,

TimeZone STRING,

ParentLocationId STRING,

IsMobile boolean,

IsInventoryLocation boolean,

VisitorAddressId STRING,

RootLocationId STRING,

LocationLevel bigint,

ExternalReference STRING

)

USING data_source

LOCATION 'abfss://xyz@xyz.dfs.core.windows.net/Bronze/Salesforce/Location'

Hello Team,

But I am getting error as :

Error in SQL statement: ClassNotFoundException:

Failed to find data source: data_source.

Please advise.

There mutliple files are present in the below mentioned path :

https://xyz.blob.core.windows.net/xyz/Bronze/Salesforce/Location

Regards

RK

1 ACCEPTED SOLUTION

Accepted Solutions

AmanSehgal
Honored Contributor III

You need to provide one of the following value for 'data_source':

  • TEXT
  • AVRO
  • CSV
  • JSON
  • PARQUET
  • ORC
  • DELTA

eg: USING PARQUET

If you skip USING clause, then the default data source is DELTA

https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-create-table-using.html

View solution in original post

4 REPLIES 4

AmanSehgal
Honored Contributor III

You need to provide one of the following value for 'data_source':

  • TEXT
  • AVRO
  • CSV
  • JSON
  • PARQUET
  • ORC
  • DELTA

eg: USING PARQUET

If you skip USING clause, then the default data source is DELTA

https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-create-table-using.html

I am new to databricks.Please can you explain to me with example.

AmanSehgal
Honored Contributor III

CREATE TABLE table_name (

column_name_1 datatype,

column_name_2 datatype,

.

.

.

.

column_name_n datatype,

)

USING data_source

LOCATION <path>

Hi @Rohit Kulkarni​,

Just a friendly follow-up. Did you have time to test AmanSehgal's sample code? do you still have issues? please let us know

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.