【发布时间】:2020-09-07 08:38:08
【问题描述】:
我有如下的 csv 文件
name|age|county|state|country
"alex"john"|"30"|"burlington"|"nj"|"usa"
我使用spark读取csv文件
input_df = spark.read.format('csv').options(header='true', inferSchema='false', sep='|').load('s3://path_to_file')
display(input_df)
输出(不知道为什么我们在 alex"john 周围有引号但在其他字段周围没有)
name age county state country
"alex"john" 30 burlington nj usa
预期输出:
name age county state country
alex"john 30 burlington nj usa
【问题讨论】:
标签: csv apache-spark pyspark