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: 

Using Parquet, passing Partition on Insert Overwrite. Partition parenthesis includes equitation and it gives an error.

saltuk
Contributor

I am new on Spark sql, we are migrating our Cloudera to Databricks. there are a lot of SQLs done, only a few are on going.

We are having some troubles during passing an argument and using it in an equitation on Partition section. LOGDATE is an argument like 20220110.

INSERT OVERWRITE TABLE  database.user_segments
 
PARTITION( month_id  =  CAST( SUBSTRING ( CAST( $LOGDATE AS STRING), 1, 6) AS INT))
 
(
 
SELECT
 
 l.license_key,

once we use this format we are getting error:

Error in SQL statement: ParseException: 
mismatched input '(' expecting STRING(line 2, pos 26)
 
== SQL ==
INSERT OVERWRITE TABLE veloxity.user_segment_by_network_usage
PARTITION( month_id = CAST( SUBSTRING ( CAST(20300101 AS STRING), 1, 6) AS INT))
--------------------------^^^

it would be great to have some help here.

best regards

0 REPLIES 0

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