当前位置:网站首页>org.apache.parquet.schema.InvalidSchemaException: A group type can not be empty. Parquet does not su
org.apache.parquet.schema.InvalidSchemaException: A group type can not be empty. Parquet does not su
2022-04-23 14:02:00 【百夜﹍悠ゼ】
1.读取cvs文件数据写入parquet文件
val spark =SparkSession.builder().appName("test").master("local").getOrCreate()
val file = "hdfs://clusters/test/demo.csv"
val frame = spark.read.option("header","true").csv(file)
frame.printSchema()
val newfile = file.split("\\.")(0)+".parquet"
frame.write.parquet(newfile)
报错提示:
org.apache.parquet.schema.InvalidSchemaException: A group type can not be empty. Parquet does not support empty group without leaves. Empty group: spark_schema
网上找了一大堆资料,大体解释都是说dataframe的schema结构问题,但本文并非此问题。
经过N次尝试,最终确定问题所在是 .parquet(newfile)。代码程序查询,发现此parquet方法调用的parquet包存在两个,默认使用了第一个包,而然这个包并非是spark-sql下的parquet包。
然后,就抱着试试的心态删除了版本1.8.1的parquet包,留下和spark依赖中的parquet包,重新运行代码,直捣黄龙。
版权声明
本文为[百夜﹍悠ゼ]所创,转载请带上原文链接,感谢
https://blog.csdn.net/AlierSnow/article/details/118966472
边栏推荐
- cnpm的诡异bug
- About note 1
- Nacos+AspnetCore+Ocelot实战编码
- 室内外地图切换(室内基于ibeacons三点定位)
- Oracle alarm log alert Chinese trace and trace files
- leetcode--380.O(1) 时间插入、删除和获取随机元素
- China creates vast research infrastructure to support ambitious climate goals
- 村上春树 --《当我谈跑步时,我谈些什么》句子摘录
- Lin Lin, product manager of Lenovo: network failure of local network operator in Tianjin. The background server of Zui system can't work normally for the time being
- JS 力扣刷题 102. 二叉树的层序遍历
猜你喜欢
随机推荐
Problems encountered in the project (V) understanding of operating excel interface poi
groutine
As a junior college student, I studied hard in closed doors for 56 days, won Ali offer with tears, five rounds of interviews and six hours of soul torture
Crontab timing task output generates a large number of mail and runs out of file system inode problem processing
Restful WebService和gSoap WebService的本质区别
L2-024 tribe (25 points)
Wechat applet
Decentralized Collaborative Learning Framework for Next POI Recommendation
Redis docker 安装
1256: bouquet for algenon
第十五章 软件工程新技术
分库分表 & ShardingSphere
MySQL 修改主数据库
Force deduction brush question 101 Symmetric binary tree
SQL: How to parse Microsoft Transact-SQL Statements in C# and to match the column aliases of a view
New关键字的学习和总结
cnpm的诡异bug
leetcode--977. Squares of a Sorted Array
基于ibeacons三点定位(微信小程序)
freeCodeCamp----time_ Calculator exercise