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

Igor Kryvenko commented on HIVE-21036:
--------------------------------------

```
could {{optional TxnType txn_type,}} in {{OpenTxnRequest}} be made required 
with the default being TxnType.DEFAULT? Seems like you wouldn't need 
{{rqst.isSetTxn_type()}} all over in that case.
```
Actually, No. We can have only 2 c'tors: the first one without parameters, in 
which we set the TxnType to DEFAULT, and the second one with all required 
parameters.  And in the case of 2 c'tor we need to manually set the correct 
TxnType in all places in the code. Also, in some places, we can't determine 
correct TxnType and it might confuse someone who will read this code. I propose 
to create a follow-up Jira to investigate it. 

> extend OpenTxnRequest with transaction type
> -------------------------------------------
>
>                 Key: HIVE-21036
>                 URL: https://issues.apache.org/jira/browse/HIVE-21036
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>    Affects Versions: 4.0.0
>            Reporter: Eugene Koifman
>            Assignee: Igor Kryvenko
>            Priority: Major
>         Attachments: HIVE-21036.01.patch, HIVE-21036.02.patch, 
> HIVE-21036.03.patch
>
>
> There is a {{TXN_TYPE}} field in {{TXNS}} table.
> There is {{TxnHandler.TxnType}} with legal values.  It would be useful to 
> TxnType a {{Thrift}}, add a new {{COMPACTION}} type object and allow setting 
> it in {{OpenTxnRequest}}.
> Since HIVE-20823 compactor starts a txn and should set this.
> Down the road we may want to set READ_ONLY either based on parsing of the 
> query or user input which can make {{TxnHandler.commitTxn}} faster.



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

Reply via email to