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

The function drop_database_core() of HiveMetaStore.java may not drop all the tables

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 1.3.0, 2.0.0
    • Component/s: Database/Schema
    • Labels:
      None

      Description

      The following code in that function doesn't work properly.

              int startIndex = 0;
              int endIndex = -1;
              // retrieve the tables from the metastore in batches to alleviate memory constraints
              while (endIndex < allTables.size() - 1) {
                startIndex = endIndex + 1;
                endIndex = endIndex + tableBatchSize;
                if (endIndex >= allTables.size()) {
                  endIndex = allTables.size() - 1;
                }
      

      e.g.: if we have 5 tables and tableBatchSize is 10, startIndex will be 0 and endIndex will be 4. We only drop 4 tables since sublist(startIndex, endIndex) is inclusive on startIndex and exclusive on endIndex.

      If total tables is larger tableBatchSize, we also have similar issues.

      This is discovered when I work on HIVE-11255.

        Attachments

        1. HIVE-11258.patch
          1 kB
          Aihua Xu

          Issue Links

            Activity

              People

              • Assignee:
                aihuaxu Aihua Xu
                Reporter:
                aihuaxu Aihua Xu
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: