嗨,我必须将json数据读取到spark df,然后我需要从spark shell以avro文件格式编写df,出现以下错误:
org.apache.spark.sql.AnalysisException: Failed to find data source: avro. Avro is built-in but external data source module since Spark 2.4. Please deploy the application as per the deployment section of "Apache Avro Data Source Guide".;
at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:647)
at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:245)
at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:229)
... 49 elided
2条答案
按热度按时间quhf5bfb1#
你试过添加spark avro库吗?
启动Spark壳时,可以按以下步骤操作:
mhd8tkvw2#
spark-avro
外部库,必须导入spark-avro
Package 成spark-shell
.检查下面