Unable to run spark.sql queries on hive table using spark-shell (Class org.apache.hadoop.fs.adl.HdiAdlFileSystem not found)

Surya Agarwal 21 Reputation points
2020-08-10T09:00:42.843+00:00

I am trying to run below query on spark-shell on HDInsight cluster:

val df=spark.sql("select * from hivesampletable")  

But it is giving below error repeatedly (irrespective of the query):

2020-08-10 07:29:21 WARN  ObjectStore:568 - Failed to get database default, returning NoSuchObjectException  
org.apache.spark.sql.AnalysisException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.hadoop.fs.adl.HdiAdlFileSystem not found;  
  at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:106)  
  at org.apache.spark.sql.hive.HiveExternalCatalog.databaseExists(HiveExternalCatalog.scala:194)  
  at org.apache.spark.sql.internal.SharedState.externalCatalog$lzycompute(SharedState.scala:114)  
  at org.apache.spark.sql.internal.SharedState.externalCatalog(SharedState.scala:102)  
  at org.apache.spark.sql.hive.HiveSessionStateBuilder.org$apache$spark$sql$hive$HiveSessionStateBuilder$$externalCatalog(HiveSessionStateBuilder.scala:39)  

16753-image.png

Although on running "hdfs dfs -ls /" command, It is listing the directories successfully which shows connectivity to DataLake Storage Gen1.

Please help me resolve the issue on priority.

Thanks

Azure HDInsight
Azure HDInsight
An Azure managed cluster service for open-source analytics.
212 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 90,221 Reputation points Microsoft Employee
    2020-08-11T08:54:22.853+00:00

    Hello @Surya Agarwal ,,

    I have created cluster type: Hadoop 2.7.3 (HDI 3.6) and able to run “spark-shell --master yarn”, without any issue.

    16915-image.png

    Gif attached:

    16966-hdi-hadoop.gif

    I’m unable to see the same error message which you are experiencing. Have you made any configuration changes?

    Hope this helps. Do let us know if you any further queries.

    ----------------------------------------------------------------------------------------

    Do click on "Accept Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.