I'm a bit new to this and have little experience, would appreciate your help. I'm trying to install Hive on an existing Spark installation.
I mostly followed the instructions in this page with no problems.
https://github.com/dryshliak/hadoop/wiki/Installing-Hive-on-existing-Hadoop-cluster
I also created a database named warehouse
and inserted a table named `test_table'.
hive> show tables;
OK
employee
test_table
Time taken: 0.084 seconds, Fetched: 2 row(s)
hive> desc test_table;
OK
col1 int Integer Column
col2 string String Column
Time taken: 0.052 seconds, Fetched: 2 row(s)
hive>
The problem I face is that when I try to insert data into the test_table
, using the command
hive> insert into test_table values(1,'aaa');
I get the below error message
Query ID = hadoop_20190703135836_4b17eeac-249d-4e54-bd98-1212f3cb5b5d Total jobs = 1
Launching Job 1 out of 1
In order to change the average load for a reducer (in bytes):
set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
set mapreduce.job.reduces=<number>
Failed to execute spark task, with exception 'org.apache.hadoop.hive.ql.metadata.HiveException (Failed to create Spark client for Spark session 821e05e7-74a8-4656-b4ed-3a622c9cadcc)'
FAILED: Execution Error, return code 30041 from org.apache.hadoop.hive.ql.exec.spark.SparkTask. Failed to create Spark client for Spark session 821e05e7-74a8-4656-b4ed-3a622c9cadcc
Below are versions that I have
RHEL Server release 7.5
Hadoop 3.1.1
Spark 2.4.0
Hive 3.1.1
Below is cut from the hive.log
file where the error occured.
2019-07-03T12:56:00,269 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: Executing command(queryId=hadoop_20190703125557_f48a3966-691d-4c42-aee0-93f81fabef66): insert into test_table values(1,'aaa')
2019-07-03T12:56:00,270 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: Query ID = hadoop_20190703125557_f48a3966-691d-4c42-aee0-93f81fabef66
2019-07-03T12:56:00,270 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: Total jobs = 1
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: Launching Job 1 out of 1
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: Starting task [Stage-1:MAPRED] in serial mode
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: In order to change the average load for a reducer (in bytes):
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: set hive.exec.reducers.bytes.per.reducer=
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: In order to limit the maximum number of reducers:
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: set hive.exec.reducers.max=
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: In order to set a constant number of reducers:
2019-07-03T12:56:00,282 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: set mapreduce.job.reduces=
2019-07-03T12:56:00,284 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] session.SparkSessionManagerImpl: Setting up the session manager.
2019-07-03T12:56:00,642 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] session.SparkSession: Trying to open Spark session e3b4aa82-29a5-4e82-b63b-742c5d35df3f
2019-07-03T12:56:00,700 ERROR [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: Failed to execute spark task, with exception 'org.apache.hadoop.hive.ql.metadata.HiveException(Failed to create Spark client for Spark session e3b4aa82-29a5-4e82-b63b-742c5d35df3f)'
org.apache.hadoop.hive.ql.metadata.HiveException: Failed to create Spark client for Spark session e3b4aa82-29a5-4e82-b63b-742c5d35df3f
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionImpl.getHiveException(SparkSessionImpl.java:221)
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionImpl.open(SparkSessionImpl.java:92)
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionManagerImpl.getSession(SparkSessionManagerImpl.java:115)
at org.apache.hadoop.hive.ql.exec.spark.SparkUtilities.getSparkSession(SparkUtilities.java:136)
at org.apache.hadoop.hive.ql.exec.spark.SparkTask.execute(SparkTask.java:115)
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:205)
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:97)
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2664)
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:2335)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:2011)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1709)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1703)
at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:157)
at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:218)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:239)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:188)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:402)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:821)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:318)
at org.apache.hadoop.util.RunJar.main(RunJar.java:232)
Caused by: java.lang.NoClassDefFoundError: org/apache/spark/SparkConf
at org.apache.hadoop.hive.ql.exec.spark.HiveSparkClientFactory.generateSparkConf(HiveSparkClientFactory.java:263)
at org.apache.hadoop.hive.ql.exec.spark.RemoteHiveSparkClient.(RemoteHiveSparkClient.java:98)
at org.apache.hadoop.hive.ql.exec.spark.HiveSparkClientFactory.createHiveSparkClient(HiveSparkClientFactory.java:76)
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionImpl.open(SparkSessionImpl.java:87)
... 24 more
Caused by: java.lang.ClassNotFoundException: org.apache.spark.SparkConf
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
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)
... 28 more
2019-07-03T12:56:00,700 ERROR [6beaec32-ecac-4dc1-b118-f2c86c385005 main] spark.SparkTask: Failed to execute spark task, with exception 'org.apache.hadoop.hive.ql.metadata.HiveException(Failed to create Spark client for Spark session e3b4aa82-29a5-4e82-b63b-742c5d35df3f)'
org.apache.hadoop.hive.ql.metadata.HiveException: Failed to create Spark client for Spark session e3b4aa82-29a5-4e82-b63b-742c5d35df3f
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionImpl.getHiveException(SparkSessionImpl.java:221) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionImpl.open(SparkSessionImpl.java:92) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionManagerImpl.getSession(SparkSessionManagerImpl.java:115) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.SparkUtilities.getSparkSession(SparkUtilities.java:136) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.SparkTask.execute(SparkTask.java:115) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:205) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:97) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2664) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:2335) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:2011) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1709) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1703) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:157) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:218) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:239) ~[hive-cli-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:188) ~[hive-cli-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:402) ~[hive-cli-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:821) ~[hive-cli-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759) ~[hive-cli-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683) ~[hive-cli-3.1.1.jar:3.1.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_191]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_191]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191]
at org.apache.hadoop.util.RunJar.run(RunJar.java:318) ~[hadoop-common-3.1.1.jar:?]
at org.apache.hadoop.util.RunJar.main(RunJar.java:232) ~[hadoop-common-3.1.1.jar:?]
Caused by: java.lang.NoClassDefFoundError: org/apache/spark/SparkConf
at org.apache.hadoop.hive.ql.exec.spark.HiveSparkClientFactory.generateSparkConf(HiveSparkClientFactory.java:263) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.RemoteHiveSparkClient.(RemoteHiveSparkClient.java:98) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.HiveSparkClientFactory.createHiveSparkClient(HiveSparkClientFactory.java:76) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionImpl.open(SparkSessionImpl.java:87) ~[hive-exec-3.1.1.jar:3.1.1]
... 24 more
Caused by: java.lang.ClassNotFoundException: org.apache.spark.SparkConf
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_191]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_191]
at org.apache.hadoop.hive.ql.exec.spark.HiveSparkClientFactory.generateSparkConf(HiveSparkClientFactory.java:263) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.RemoteHiveSparkClient.(RemoteHiveSparkClient.java:98) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.HiveSparkClientFactory.createHiveSparkClient(HiveSparkClientFactory.java:76) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.hadoop.hive.ql.exec.spark.session.SparkSessionImpl.open(SparkSessionImpl.java:87) ~[hive-exec-3.1.1.jar:3.1.1]
... 24 more
2019-07-03T12:56:00,701 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] reexec.ReOptimizePlugin: ReOptimization: retryPossible: false
2019-07-03T12:56:00,701 ERROR [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: FAILED: Execution Error, return code 30041 from org.apache.hadoop.hive.ql.exec.spark.SparkTask. Failed to create Spark client for Spark session e3b4aa82-29a5-4e82-b63b-742c5d35df3f
2019-07-03T12:56:00,701 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: Completed executing command(queryId=hadoop_20190703125557_f48a3966-691d-4c42-aee0-93f81fabef66); Time taken: 0.432 seconds
2019-07-03T12:56:00,701 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] ql.Driver: Concurrency mode is disabled, not creating a lock manager
2019-07-03T12:56:00,721 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] conf.HiveConf: Using the default value passed in for log id: 6beaec32-ecac-4dc1-b118-f2c86c385005
2019-07-03T12:56:00,721 INFO [6beaec32-ecac-4dc1-b118-f2c86c385005 main] session.SessionState: Resetting thread name to main