Symptom:
When using spark-sql-perf with a Hive Metastore 3.x, it fails with error:
java.lang.NoSuchMethodException:
org.apache.hadoop.hive.ql.metadata.Hive.alterTable(java.lang.String, org.apache.hadoop.hive.ql.metadata.Table, org.apache.hadoop.hive.metastore.api.EnvironmentContext)
Env:
Hive 3.x
Root Cause:
This is due to the latest branch of spark-sql-perf is still using Hive 2.x artifacts to compile, but here our Hive Metastore is 3.x version.
And between Hive 2.x and 3.x, the signature for method "alterTable" in java class "org.apache.hadoop.hive.ql.metadata.Hive" changed a lot.
In Hive 3.x:
$ grep alterTable ./ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java |grep public
public void alterTable(Table newTbl, boolean cascade, EnvironmentContext environmentContext,
public void alterTable(String fullyQlfdTblName, Table newTbl, EnvironmentContext environmentContext,
public void alterTable(String fullyQlfdTblName, Table newTbl, boolean cascade,
public void alterTable(String fullyQlfdTblName, Table newTbl, boolean cascade,
public void alterTable(String catName, String dbName, String tblName, Table newTbl, boolean cascade,
public void alterTable(String catName, String dbName, String tblName, Table newTbl, boolean cascade,
In Hive 2.3.8:
$ git checkout rel/release-2.3.8
$ grep alterTable ./ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java |grep public
public void alterTable(String tblName, Table newTbl, EnvironmentContext environmentContext)
public void alterTable(String tblName, Table newTbl, boolean cascade, EnvironmentContext environmentContext)
As we can see from above, in Hive 3.x, there is no such signature with below 3 input parameters' data type anymore:
(java.lang.String, org.apache.hadoop.hive.ql.metadata.Table, org.apache.hadoop.hive.metastore.api.EnvironmentContext)
Solution:
This is a workaround by just using Hive 2.x jars in the pre-built 2.x tarball:
https://hive.apache.org/downloads.html
And then in spark-defaults.conf, change it to above jars:
spark.sql.hive.metastore.jars /xxx/apache-hive-2.3.8-bin/lib/*
2DC1331BC6
ReplyDeleteInstagram Ücretsiz Takipçi
Youtube İzlenme Hilesi
Youtube Ücretsiz İzlenme
Kwai Beğeni Hilesi
Snapchat Takipçi Hilesi
Tumblr Ücretsiz Takipçi
Linkedin Ücretsiz Takipçi
Instagram Hikaye Görme
Brawl Stars Elmas Hilesi
Compatibility between Apache Spark, Hive, and their respective dependencies is an important consideration when configuring big data environments. The NoSuchMethodException described here illustrates how differences in method signatures between Hive 2.x and Hive 3.x can cause runtime failures, even when an application compiles successfully. Identifying the Hive version expected by the application and aligning the metastore dependencies accordingly is a practical troubleshooting approach.
DeleteFor developers interested in distributed data processing and Spark-based applications, PySpark Online Training in India is a relevant learning resource. Understanding Spark configurations, dependency management, and integration with the Hadoop ecosystem can help developers diagnose similar issues more efficiently.
Additionally, Data Engineering Online Training in India is relevant for learners exploring the broader architecture of data pipelines and data processing systems. A solid understanding of framework compatibility and environment configuration is essential for building reliable and maintainable data engineering solutions.
Delete0443E8EC
ReplyDeleteForum
Forum
Forum
Forum
Forum
Forum
Forum
Forum
Forum