Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created December 27, 2021 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1ambda/845feafbc2c934da59e3c5c81bb79e4c to your computer and use it in GitHub Desktop.
Save 1ambda/845feafbc2c934da59e3c5c81bb79e4c to your computer and use it in GitHub Desktop.
dfCalendarMetaMonth = spark.sql("""
SELECT sequence(to_date('2020-01-01'), to_date('2020-12-31'), interval 1 month) as date
""")\
.withColumn("date", explode(col("date")))\
.orderBy(asc(col("date")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment