赞
踩
- from pyspark import SparkConf
- from pyspark.sql import SparkSession
-
- #创建spark会话
- spark = SparkSession.builder.getOrCreate()
- parquetfile='parquet_file_name.parquet'
-
- df=spark.read.parquet(curfile) #读取parquet文件
-
- # df.printSchema()
- #显示第一行
- # print(df.first())
-
- df.write.option("header",True) .csv("jupyter_workspace/data/20220831")
-
-
- #参考 https://sparkbyexamples.com/pyspark/pyspark-write-dataframe-to-csv-file/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。