Created
December 21, 2021 23:33
-
-
Save 1ambda/0a44754cf77b1c6ad97b3816194757f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dfJson = dfPrepared\ | |
.where(col("category_code").isNotNull())\ | |
.withColumn("category", to_json(struct(col("category_id"), col("category_code"))))\ | |
dfJson.printSchema() | |
dfJson.show(truncate=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment