当前位置:   article > 正文

java.lang.VerifyError: class org.apache.spark.sql.hive.HiveExternalCatalog overrides final method al_lorg/apache/spark/sql/catalyst/catalog/externalcat

lorg/apache/spark/sql/catalyst/catalog/externalcatalog;

java.lang.VerifyError: class org.apache.spark.sql.hive.HiveExternalCatalog overrides final method alterDatabase.(Lorg/apache/spark/sql/catalyst/catalog/CatalogDatabase;)V
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
  at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog$lzycompute(HiveSessionStateBuilder.scala:53)
  at org.apache.spark.sql.hive.HiveSessionStateBuilder.catalog(HiveSessionStateBuilder.scala:52)
  at org.apache.spark.sql.hive.HiveSessionStateBuilder

anon$1.<init>(HiveSessionStateBuilder.scala:69)atorg.apache.spark.sql.hive.HiveSessionStateBuilder.analyzer(HiveSessionStateBuilder.scala:69)atorg.apache.spark.sql.internal.BaseSessionStateBuilder
anonfun$build$2.apply(BaseSessionStateBuilder.scala:293)
  at org.apache.spark.sql.internal.BaseSessionStateBuilder
anonfun$build$2.apply(BaseSessionStateBuilder.scala:293)atorg.apache.spark.sql.internal.SessionState.analyzer$lzycompute(SessionState.scala:79)atorg.apache.spark.sql.internal.SessionState.analyzer(SessionState.scala:79)atorg.apache.spark.sql.execution.QueryExecution.analyzed$lzycompute(QueryExecution.scala:57)atorg.apache.spark.sql.execution.QueryExecution.analyzed(QueryExecution.scala:55)atorg.apache.spark.sql.execution.QueryExecution.assertAnalyzed(QueryExecution.scala:47)atorg.apache.spark.sql.Dataset$.ofRows(Dataset.scala:74)atorg.apache.spark.sql.SparkSession.baseRelationToDataFrame(SparkSession.scala:428)atorg.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:233)atorg.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:227)atorg.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:174)atcom.databricks.spark.avro.package$AvroDataFrameReader
anonfun$avro$2.apply(package.scala:34)
  at com.databricks.spark.avro.package$AvroDataFrameReader$$anonfun$avro$2.apply(package.scala:34)

 

报错是因为倒入错误的pom文件,spark-hive 和spark-sql下面都有SparkSession类,因此 类加载器验证错误 。pom中删除spark-sql就可以了,使用spark-hive 就可以对hive进行读写

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/134601
推荐阅读
相关标签
  

闽ICP备14008679号