📜  pyspark from_json 示例 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:31.995000             🧑  作者: Mango

代码示例1
from pyspark.sql.functions import from_json, col
json_schema = spark.read.json(df.rdd.map(lambda row: row.json)).schema
df.withColumn('json', from_json(col('json'), json_schema))