Skip to content

Instantly share code, notes, and snippets.

@1ambda
Created December 21, 2021 00:48
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/ee897c130cf3eda59d57d15fbe8839ba to your computer and use it in GitHub Desktop.
Save 1ambda/ee897c130cf3eda59d57d15fbe8839ba to your computer and use it in GitHub Desktop.
dfPartitioned = dfConverted.repartition(5)
# foreach 함수는 Callback 파라미터로 Spark.DataFrame 의 Row 를 '하나씩' 전달합니다.
def persist(row):
parsed = row.asDict()
# Do something here
dfPartitioned.foreach(persist)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment