读取或写入Parquet格式数据时出错

问题描述

我创建了一个外部表,该表指向具有镶木地板存储的Azure ADLS,并且在将数据插入该表时出现以下错误。我正在使用Databricks执行

org.apache.spark.sql.AnalysisException: Multiple sources found for parquet (org.apache.spark.sql.execution.datasources.v2.parquet.ParquetDataSourceV2,org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat),please specify the fully qualified class name.;

昨天这一切正常,我从今天开始就收到了这个错误。

我在互联网上找不到关于为什么发生这种情况的任何答案。

解决方法

如果您想要一种无需清理依赖项的解决方法。以下是您选择其中一个来源的方法(以“org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat”为例):

替换:

spark.read.parquet("<path_to_parquet_file>")

spark.read.format("org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat").load("<path_to_parquet_file>")

,

此问题已得到解决,错误的原因是,我们安装了Azure提供的spark sqldb连接器以及uber jar,该连接器也具有wrt parquet文件格式化程序的依赖项。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...