Skip to content

Instantly share code, notes, and snippets.

@64lines
Created February 19, 2019 22:32
Show Gist options
  • Save 64lines/1a2959b9cdb8ba7f8c24cc80c0232eee to your computer and use it in GitHub Desktop.
Save 64lines/1a2959b9cdb8ba7f8c24cc80c0232eee to your computer and use it in GitHub Desktop.
from pyspark.sql.functions import *
# Generating continuous ids on random rows
fact_df = fact_df.withColumn('id', row_number().over(Window.orderBy(rand()))).alias('fact_df')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment