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

Eugene Koifman commented on HIVE-17683:
---------------------------------------

[~ikryvenko], sorry, it took a while to get back to this.

Your implementation creates ExplainTask.getJsonLocks() which duplicates a lot 
of the logic in DbTxnManger.acquireLocks().  This is problematic because they 
have to be kept in sync.

Could you refactor it so that they share code?

For example, create a {{LockRequest makeLockRequest(List<ReadEntiry>, 
List<WriteEntity>)}} and use it in both places?

 

Also, the refactoring in acquireLocks() lost
{noformat}
default:
  throw new IllegalArgumentException(String
      .format("Lock type [%s] for Database.Table [%s.%s] is unknown", lockType, 
t.getDbName(),
          t.getTableName()
      ));{noformat}
This may change how errors are surfaced - not sure it's a good idea.

> Annotate Query Plan with locking information
> --------------------------------------------
>
>                 Key: HIVE-17683
>                 URL: https://issues.apache.org/jira/browse/HIVE-17683
>             Project: Hive
>          Issue Type: New Feature
>          Components: Transactions
>            Reporter: Eugene Koifman
>            Assignee: Igor Kryvenko
>            Priority: Critical
>         Attachments: HIVE-17683.01.patch, HIVE-17683.02.patch
>
>
> Explore if it's possible to add info about what locks will be asked for to 
> the query plan.
> Lock acquisition (for Acid Lock Manager) is done in 
> DbTxnManager.acquireLocks() which is called once the query starts running.  
> Would need to refactor that.



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

Reply via email to