hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Newberger <>
Subject RE: Creating a Hive table through Spark and potential locking issue (a bug)
Date Wed, 08 Jun 2016 19:22:30 GMT
Could you be looking at 2 jobs trying to use the same file and one getting to it before the
other and finally removing it?

David Newberger

From: Mich Talebzadeh []
Sent: Wednesday, June 8, 2016 1:33 PM
To: user; user @spark
Subject: Creating a Hive table through Spark and potential locking issue (a bug)


I noticed an issue with Spark creating and populating a Hive table.

The process as I see is as follows:

  1.  Spark creates the Hive table. In this case an ORC table in a Hive Database
  2.  Spark uses JDBC connection to get data out from an Oracle
  3.  I create a temp table in Spark through (registerTempTable)
  4.  Spark populates that table. That table is actually created in

       hdfs dfs -ls /tmp/hive/hduser
       drwx------   - hduser supergroup

  1.  However, The original table itself does not have any locking on it!
  2.  I log in into Hive and drop that table

3. hive> drop table dummy;

  1.   That table is dropped OK
  2.  Spark crashes with message
Started at
[08/06/2016 18:37:53.53]
16/06/08 19:13:46 ERROR Executor: Exception in task 0.0 in stage 1.0 (TID 1)
No lease on /user/hive/warehouse/oraclehadoop.db/dummy/.hive-staging_hive_2016-06-08_18-38-08_804_3299712811201460314-1/-ext-10000/_temporary/0/_temporary/attempt_201606081838_0001_m_000000_0/part-00000
(inode 831621): File does not exist. Holder DFSClient_NONMAPREDUCE_-1836386597_1 does not
have any open files.
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkLease(
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.analyzeFileState(
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(
        at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(
        at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(
        at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$
        at org.apache.hadoop.ipc.RPC$
        at org.apache.hadoop.ipc.Server$Handler$
        at org.apache.hadoop.ipc.Server$Handler$
        at Method)
        at org.apache.hadoop.ipc.Server$
        at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(
        at com.sun.proxy.$Proxy22.addBlock(Unknown Source)
        at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.addBlock(
        at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at com.sun.proxy.$Proxy23.addBlock(Unknown Source)
        at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.locateFollowingBlock(
        at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(
        at org.apache.hadoop.hdfs.DFSOutputStream$
16/06/08 19:13:46 ERROR TaskSetManager: Task 0 in stage 1.0 failed 1 times; aborting job

Suggested solution.
In a concurrent env, Spark should apply locks in order to prevent such operations. Locks are
kept in Hive meta data table HIVE_LOCKS

Dr Mich Talebzadeh


View raw message