[ 
https://issues.apache.org/jira/browse/HIVE-24501?focusedWorklogId=521620&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-521620
 ]

ASF GitHub Bot logged work on HIVE-24501:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Dec/20 10:35
            Start Date: 08/Dec/20 10:35
    Worklog Time Spent: 10m 
      Work Description: prasanthj opened a new pull request #1752:
URL: https://github.com/apache/hive/pull/1752


   ### What changes were proposed in this pull request?
   When UpdateInputAccessTimeHook is used as pre-hook, any simple queries on 
transactional table throws exception (full stactrace in 
https://issues.apache.org/jira/browse/HIVE-24501)
   ```
   org.apache.hadoop.hive.ql.metadata.HiveException(Unable to alter table. 
Cannot change stats state for a transactional table default.test without 
providing the transactional write state for verification
   ```
   For updating only access time, the stats of table and partitions does not 
have to be updated. This PR sets environment context to skip updating the stats.
   
   ### Why are the changes needed?
   Bug with exception trace in https://issues.apache.org/jira/browse/HIVE-24501
   
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   
   ### How was this patch tested?
   Manually on dev cluster.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 521620)
    Remaining Estimate: 0h
            Time Spent: 10m

> UpdateInputAccessTimeHook should not update stats
> -------------------------------------------------
>
>                 Key: HIVE-24501
>                 URL: https://issues.apache.org/jira/browse/HIVE-24501
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>            Reporter: Prasanth Jayachandran
>            Assignee: Prasanth Jayachandran
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> UpdateInputAccessTimeHook can fail for transactional tables with following 
> exception.
> The hook should skip updating the stats and only update the access time.
> {code:java}
> ERROR : FAILED: Hive Internal Error: 
> org.apache.hadoop.hive.ql.metadata.HiveException(Unable to alter table. 
> Cannot change stats state for a transactional table default.test without 
> providing the transactional write state for verification (new write ID 0, 
> valid write IDs default.test:8:9223372036854775807::1,2,3,4,7; current state 
> {"BASIC_STATS":"true","COLUMN_STATS":{"id":"true","name":"true"}}; new state 
> null)ERROR : FAILED: Hive Internal Error: 
> org.apache.hadoop.hive.ql.metadata.HiveException(Unable to alter table. 
> Cannot change stats state for a transactional table default.test without 
> providing the transactional write state for verification (new write ID 0, 
> valid write IDs default.test:8:9223372036854775807::1,2,3,4,7; current state 
> {"BASIC_STATS":"true","COLUMN_STATS":{"id":"true","name":"true"}}; new state 
> null)org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter table. 
> Cannot change stats state for a transactional table default.test without 
> providing the transactional write state for verification (new write ID 0, 
> valid write IDs default.test:8:9223372036854775807::1,2,3,4,7; current state 
> {"BASIC_STATS":"true","COLUMN_STATS":{"id":"true","name":"true"}}; new state 
> null at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:821) at 
> org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:769) at 
> org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:756) at 
> org.apache.hadoop.hive.ql.hooks.UpdateInputAccessTimeHook$PreExec.run(UpdateInputAccessTimeHook.java:70)
>  at 
> org.apache.hadoop.hive.ql.HookRunner.invokeGeneralHook(HookRunner.java:296) 
> at org.apache.hadoop.hive.ql.HookRunner.runPreHooks(HookRunner.java:273) at 
> org.apache.hadoop.hive.ql.Executor.preExecutionActions(Executor.java:155) at 
> org.apache.hadoop.hive.ql.Executor.execute(Executor.java:107) at 
> org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:721) at 
> org.apache.hadoop.hive.ql.Driver.run(Driver.java:488) at 
> org.apache.hadoop.hive.ql.Driver.run(Driver.java:482) at 
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:166) at 
> org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:225)
>  at 
> org.apache.hive.service.cli.operation.SQLOperation.access$700(SQLOperation.java:87)
>  at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:322)
>  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:1876)
>  at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:340)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at 
> java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)Caused by: 
> MetaException(message:Cannot change stats state for a transactional table 
> default.test without providing the transactional write state for verification 
> (new write ID 0, valid write IDs 
> default.test:8:9223372036854775807::1,2,3,4,7; current state 
> {"BASIC_STATS":"true","COLUMN_STATS":{"id":"true","name":"true"}}; new state 
> null) at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_req_result$alter_table_req_resultStandardScheme.read(ThriftHiveMetastore.java)
>  at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_req_result$alter_table_req_resultStandardScheme.read(ThriftHiveMetastore.java)
>  at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$alter_table_req_result.read(ThriftHiveMetastore.java)
>  at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:86) at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_alter_table_req(ThriftHiveMetastore.java:2584)
>  at 
> org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.alter_table_req(ThriftHiveMetastore.java:2571)
>  at 
> org.apache.hadoop.hive.metastore.HiveMetaStoreClient.alter_table(HiveMetaStoreClient.java:487)
>  at 
> org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.alter_table(SessionHiveMetaStoreClient.java:453)
>  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.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:212)
>  at com.sun.proxy.$Proxy35.alter_table(Unknown Source) 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.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:3411)
>  at com.sun.proxy.$Proxy35.alter_table(Unknown Source) at 
> org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:817) ... 25 more 
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to