You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "BELUGA BEHR (JIRA)" <ji...@apache.org> on 2017/12/19 01:28:00 UTC

[jira] [Created] (HIVE-18300) Use LAST_INSERT_ID for Sequence Tables for MySQL

BELUGA BEHR created HIVE-18300:
----------------------------------

             Summary: Use LAST_INSERT_ID for Sequence Tables for MySQL
                 Key: HIVE-18300
                 URL: https://issues.apache.org/jira/browse/HIVE-18300
             Project: Hive
          Issue Type: Improvement
          Components: HiveServer2
    Affects Versions: 3.0.0
            Reporter: BELUGA BEHR
            Priority: Trivial


Instead of using SELECT FOR UPDATE, for MYSQL, use the recommended approach which only requires once client interaction instead of two:

{code:sql}
UPDATE child_codes SET counter_field = LAST_INSERT_ID(counter_field + 1);
SELECT LAST_INSERT_ID();
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)