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