当前位置:网站首页>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
边栏推荐
- 全局变量能否放在头文件中定义
- Haruki Murakami -- Excerpt from "what do I talk about when I talk about running"
- Android interview theme collection
- Un modèle universel pour la construction d'un modèle d'apprentissage scikit
- leetcode--977. Squares of a Sorted Array
- 淘宝发布宝贝提示“您的消保保证金额度不足,已启动到期保障”
- What is the difference between blue-green publishing, rolling publishing and gray publishing?
- websocket
- mysql新表,自增id长达20位,原因竟是......
- redis如何解决缓存雪崩、缓存击穿和缓存穿透问题
猜你喜欢
JS 烧脑面试题大赏
Program compilation and debugging learning record
关于pthread多线程一些好文章
Oracle alarm log alert Chinese trace and trace files
crontab定时任务输出产生大量邮件耗尽文件系统inode问题处理
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
SQL数据库
Quartus Prime硬件实验开发(DE2-115板)实验一CPU指令运算器设计
scikit-learn構建模型的萬能模板
Programming travel function
随机推荐
New关键字的学习和总结
1256: bouquet for algenon
微信小程序获取登录用户信息、openid和access_token
Interesting talk about network protocol
变长参数__VA_ARGS__ 和 写日志的宏定义
微信小程序与低功耗蓝牙通信-往硬件端发送数据(三)
Basic knowledge learning record
Program compilation and debugging learning record
Force deduction brush question 101 Symmetric binary tree
Taobao released the baby prompt "your consumer protection deposit is insufficient, and the expiration protection has been started"
Jiannanchun understood the word game
Haruki Murakami -- Excerpt from "what do I talk about when I talk about running"
MySQL 修改主数据库
Wechat applet
SPC简介
基于微信小程序的wifi模块使用
3300万IOPS、39微秒延迟、碳足迹认证,谁在认真搞事情?
关于stream流,浅记一下------
mysql新表,自增id长达20位,原因竟是......
elmo(BiLSTM-CRF+elmo)(Conll-2003 命名实体识别NER)