cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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
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.