HiveServer2 Concurrency is Not Working Even Though the HS2 Concurrency Flag is Set "message:javax.jdo.JDODataStoreException" Exceptions are Raised (Doc ID 2146928.1)

Last updated on JUNE 07, 2016

Applies to:

Big Data Appliance Integrated Software - Version 4.1.0 and later
Linux x86-64

Symptoms

HiveServer2 concurrency does not work even though the concurrency flag is set for HS2.  The scenario is:

1. The HS2 concurrency flag is set:

<property>
<name>hive.support.concurrency</name>
<value>true</value>
</property>
<property>
<name>hive.zookeeper.quorum</name>
<value>bdanode01.example.com,bdanode02.example.com,bdanode03.example.com</value>
</property>


2. There are multiple concurrent/parallel beeline jobs copying data from staging tables to the same final Hive managed table. There are times when all of the beeline sessions/jobs are trying to insert into the table at the same time.

3. However the following failures are observed:

a)  The Metastore fails with: MetaException(message:javax.jdo.JDODataStoreException: Insert of object:

1 ERROR org.apache.hadoop.hive.ql.exec.Task: Failed with exception MetaException(message:javax.jdo.JDODataStoreException: Insert of object  "org.apache.hadoop.hive.metastore.model.X@Y" using statement  "INSERT INTO `PARTITIONS` (`X`,`Y`,`Z`,`Z1`,`A`,`B`)  VALUES (?,?,?,?,?,?)" failed : Duplicate entry 'as_of_date=2016-04-26-230716' for key 'X'
1 ERROR org.apache.hadoop.hive.ql.exec.Task: Error during job, obtaining debugging information...



b) The Hiveserver2.log shows:

2016-04-26 08:36:40,816 ERROR hive.ql.metadata.Hive: MetaException(message:javax.jdo.JDODataStoreException:
Insert of object "org.apache.hadoop.hive.metastore.model.X@Y using statement "INSERT INTO `PARTITIONS` (`X`,`Y`,`Z`,`A`,`B`,`C`)  VALUES (?,?,?,?,?,?)" failed : Duplicate entry 'as_of_date=2016-04-26-75871' for key 'X'
NestedThrowables:
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'as_of_date=2016-04-26-75871' for key 'X')
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$append_partition_with_environment_context_result$append_partition_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:41079)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$append_partition_with_environment_context_result$append_partition_with_environment_context_resultStandardScheme.read(ThriftHiveMetastore.java:41038)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$append_partition_with_environment_context_result.read(ThriftHiveMetastore.java:40961)
  at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_append_partition_with_environment_context(ThriftHiveMetastore.java:1355)
  at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.append_partition_with_environment_context(ThriftHiveMetastore.java:1339)
  at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.appendPartition(HiveMetaStoreClient.java:494)
  at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.appendPartition(HiveMetaStoreClient.java:488)
  at sun.reflect.GeneratedMethodAccessor203.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:90)
  at com.sun.proxy.$Proxy6.appendPartition(Unknown Source)
  at org.apache.hadoop.hive.ql.metadata.Hive.getPartition(Hive.java:1652)
  at org.apache.hadoop.hive.ql.metadata.Hive.loadPartition(Hive.java:1280)
  at org.apache.hadoop.hive.ql.metadata.Hive.loadDynamicPartitions(Hive.java:1462)
  at org.apache.hadoop.hive.ql.exec.MoveTask.execute(MoveTask.java:357)
  at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:153)
  at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:85)
  at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1554)
  at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1321)
  at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1139)
  at org.apache.hadoop.hive.ql.Driver.run(Driver.java:962)
  at org.apache.hadoop.hive.ql.Driver.run(Driver.java:957)
  at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:145)
  at org.apache.hive.service.cli.operation.SQLOperation.access$000(SQLOperation.java:69)
  at org.apache.hive.service.cli.operation.SQLOperation$1$1.run(SQLOperation.java:200)
  at java.security.AccessController.doPrivileged(Native Method)

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms