[ 
https://issues.apache.org/jira/browse/HIVE-20080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16534281#comment-16534281
 ] 

Eugene Koifman commented on HIVE-20080:
---------------------------------------

There is TxnUtils.buildQueryWithINClause() built for such issues (and more).  
It currently works for INT in list.  It would make more sense to extend that to 
handle other types.

> TxnHandler checkLock direct sql fail with ORA-01795 , if the table has more 
> than 1000 partitions
> ------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-20080
>                 URL: https://issues.apache.org/jira/browse/HIVE-20080
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 2.1.0
>            Reporter: Rajkumar Singh
>            Assignee: Rajkumar Singh
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-20080.patch
>
>
> with Oracle as Metastore, txnhandler checkLock fail with 
> "checkLockWithRetry(181398,34773) : ORA-01795: maximum number of expressions 
> in a list is 1000" if the write table has more than 1000 partitions.
> complete stacktrace
> {code}
> txn.TxnHandler (TxnHandler.java:checkRetryable(2099)) - Non-retryable error 
> in checkLockWithRetry(181398,34773) : ORA-01795: maximum number of 
> expressions in a list is 1000
>  (SQLState=42000, ErrorCode=1795)
> 2018-06-25 15:09:35,999 ERROR [pool-7-thread-197]: 
> metastore.RetryingHMSHandler (RetryingHMSHandler.java:invokeInternal(203)) - 
> MetaException(message:Unable to update transaction database 
> java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in 
> a list is 1000
>  
>     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
>     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
>     at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
>     at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
>     at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
>     at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
>     at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:195)
>     at 
> oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:876)
>     at 
> oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
>     at 
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
>     at 
> oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1498)
>     at 
> oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:406)
>     at 
> com.jolbox.bonecp.StatementHandle.executeQuery(StatementHandle.java:464)
>     at 
> org.apache.hadoop.hive.metastore.txn.TxnHandler.checkLock(TxnHandler.java:2649)
>     at 
> org.apache.hadoop.hive.metastore.txn.TxnHandler.checkLockWithRetry(TxnHandler.java:1126)
>     at 
> org.apache.hadoop.hive.metastore.txn.TxnHandler.lock(TxnHandler.java:895)
>     at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.lock(HiveMetaStore.java:6123)
>     at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:147)
>     at 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:105)
>     at com.sun.proxy.$Proxy11.lock(Unknown Source)
>     at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$lock.getResult(ThriftHiveMetastore.java:12012)
>     at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$lock.getResult(ThriftHiveMetastore.java:11996)
>     at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
>     at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
>     at 
> org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor$1.run(HadoopThriftAuthBridge.java:551)
>     at 
> org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor$1.run(HadoopThriftAuthBridge.java:546)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at javax.security.auth.Subject.doAs(Subject.java:422)
>     at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1866)
>     at 
> org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor.process(HadoopThriftAuthBridge.java:546)
>     at 
> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>     at java.lang.Thread.run(Thread.java:748)
> )
>     at 
> org.apache.hadoop.hive.metastore.txn.TxnHandler.checkLockWithRetry(TxnHandler.java:1131)
>     at 
> org.apache.hadoop.hive.metastore.txn.TxnHandler.lock(TxnHandler.java:895)
>     at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.lock(HiveMetaStore.java:6123)
>     at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:498)
>     at 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:147)
>     at 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:105)
>     at com.sun.proxy.$Proxy11.lock(Unknown Source)
>     at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$lock.getResult(ThriftHiveMetastore.java:12012)
>     at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$lock.getResult(ThriftHiveMetastore.java:11996)
>     at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
>     at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
>     at 
> org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor$1.run(HadoopThriftAuthBridge.java:551)
>     at 
> org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor$1.run(HadoopThriftAuthBridge.java:546)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at javax.security.auth.Subject.doAs(Subject.java:422)
>     at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1866)
> {code}
> the problem seems to be with direct sql where hive send all the parititions 
> using IN clause. 
> https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java#L3746



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to