![]() |
帅气的领带 · 【Pyspark ...· 2 天前 · |
![]() |
时尚的蘑菇 · pyspark的窗口函数--Window、o ...· 2 天前 · |
![]() |
多情的黑框眼镜 · 《圣之魔物》流程攻略_游戏攻略_电视游戏0_ ...· 1 年前 · |
![]() |
豪气的毛豆 · 福田2023年高一签约招生公告 - 抖音· 1 年前 · |
![]() |
从容的排球 · 校长赵长林带队参加2023年东南亚地区孔子学 ...· 1 年前 · |
![]() |
心软的香瓜 · 许晋亨前妻亲证已离婚 ...· 1 年前 · |
![]() |
博学的板凳 · 关于公布杭州市区外民办普通高中面向市区统筹招 ...· 1 年前 · |
from pyspark.sql import Window, DataFrame
from pyspark.sql.types import *
from pyspark.sql.types import StructType
from pyspark.sql import functions as F
schema = StructType([
StructField("data", StructType([
StructField("indicatr", StructType([
StructField("indicatr", StructType([
StructField("id", StringType())
]))]))]))])
df = spark.read.json("pathtofile/test.json", multiLine=True)
df.show()
df2 = df.withColumn("json", F.col("data").cast("string"))
df3=df2.select(F.col("json"))
df3.collect()
df4 =df3.select(F.from_json(F.col("json"), schema).alias("name"))
df4.show()
我得到以下结果:
|name|
+----+
|null|
谁知道如何解决这个问题
企业邮箱发送邮件时,若出现投递失败产生退信,内容提示包含如下: the mta server of * reply:550 failed to meet SPF requirements 或者 the mta server of 163.com — 163mx01.mxmail.netease.com(220.181.14.141) reply:550 MI:SPF mx14,QMCowECpA0qTiftVaeB3Cg—.872S2 1442548128 http://mail.163.com/help
303476
![]() |
豪气的毛豆 · 福田2023年高一签约招生公告 - 抖音 1 年前 |