Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18300

Use LAST_INSERT_ID for Sequence Tables for MySQL

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 3.0.0
    • None
    • HiveServer2
    • None

    Description

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

      UPDATE child_codes SET counter_field = LAST_INSERT_ID(counter_field + 1);
      SELECT LAST_INSERT_ID();
      

      https://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: