Skip to content

Instantly share code, notes, and snippets.

@aialenti
Created October 28, 2019 01:07
Show Gist options
  • Save aialenti/20650adea8347e4459478f5bf651b436 to your computer and use it in GitHub Desktop.
Save aialenti/20650adea8347e4459478f5bf651b436 to your computer and use it in GitHub Desktop.
// Create a dummy column which is a number between 0 and 1000, then append this suffix to the dimension_2_id column
fact_table = fact_table.withColumn("dummy", monotonically_increasing_id % 1000).
withColumn("dimension_2_id_suffix",concat(col("dimension_2_id"),lit("-"), col("dummy")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment