Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created December 26, 2021 23:30
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/956920db6ab4c5c015dc83ce9d164fb2 to your computer and use it in GitHub Desktop.
Save 1ambda/956920db6ab4c5c015dc83ce9d164fb2 to your computer and use it in GitHub Desktop.
dfListingAvailabilityFinal\
.repartition(2)\
.write\
.format("parquet")\
.mode("overwrite")\
.save("s3://airbnb-data-lake/db/listing_availability")
# Spark Session 시작 후 스키마가 변경될 경우 REFRESH TABLE 을 이용해 테이블 정보를 다시 받아올 수 있습니다
# spark.catalog.refreshTable("airbnb_db.listing_availability") 와 동일
spark.sql("REFRESH TABLE airbnb_db.listing_availability")
spark.sql("""
SELECT *
FROM airbnb_db.listing_availability
""").show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment