You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Marton Bod (Jira)" <ji...@apache.org> on 2020/04/03 12:21:00 UTC
[jira] [Commented] (HIVE-22750) Consolidate LockType naming
[ https://issues.apache.org/jira/browse/HIVE-22750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17074539#comment-17074539 ]
Marton Bod commented on HIVE-22750:
-----------------------------------
Original LockType enum cannot be extended with char/string value, because Thrift limits the enum values to be integers: [https://thrift.apache.org/docs/idl#enum]
> Consolidate LockType naming
> ---------------------------
>
> Key: HIVE-22750
> URL: https://issues.apache.org/jira/browse/HIVE-22750
> Project: Hive
> Issue Type: Improvement
> Components: Transactions
> Reporter: Zoltan Chovan
> Assignee: Marton Bod
> Priority: Minor
> Attachments: HIVE-22750.1.patch
>
>
> Extend enum with string literal to remove unnecessary `id` to `char` casting for the LockType:
> {code:java}
> switch (lockType) {
> case EXCLUSIVE:
> lockChar = LOCK_EXCLUSIVE;
> break;
> case SHARED_READ:
> lockChar = LOCK_SHARED;
> break;
> case SHARED_WRITE:
> lockChar = LOCK_SEMI_SHARED;
> break;
> }
> {code}
> Consolidate LockType naming in code and schema upgrade scripts:
> {code:java}
> CASE WHEN HL.`HL_LOCK_TYPE` = 'e' THEN 'exclusive' WHEN HL.`HL_LOCK_TYPE` = 'r' THEN 'shared' WHEN HL.`HL_LOCK_TYPE` = 'w' THEN *'semi-shared'* END AS LOCK_TYPE,
> {code}
> +*Lock types:*+
> EXCLUSIVE
> EXCL_WRITE
> SHARED_WRITE
> SHARED_READ
--
This message was sent by Atlassian Jira
(v8.3.4#803005)