Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4357

Fix DROP TABLE to pass analysis if the table fails to load

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Kudu_Impala
    • Fix Version/s: Impala 2.8.0
    • Component/s: Catalog
    • Labels:

      Description

      In general, we want to be able to drop tables even if they fail to load, since otherwise you might end up with a table in a bad state that can't be dropped.

      For example, if a Kudu table is created as a managed table in Impala, then dropped directly in Kudu (i.e. HMS still thinks it exists), then the table must be dropped with "DROP TABLE IF EXISTS". Other operations (including setting TBLPROPERTIES) will fail w/ the error that the table cannot be loaded.

      If table 'managed_kudu' is in this state, regular operations will fail because the table does not exist, but even attempting to drop the table without this workaround result in this error:

      ERROR: AnalysisException: The table does not exist: table_name: "managed_kudu"
      CAUSED BY: TableLoadingException: The table does not exist: table_name: "managed_kudu"
      

      Dropping with `IF EXISTS` does work:

      [localhost:21000] > drop table if exists managed_kudu;
      Query: drop table if exists managed_kudu
      

        Activity

        Hide
        twmarshall Thomas Tauber-Marshall added a comment -

        commit 7bcb51b152ac0b2e7660ec96b1ee94e5ab906abd
        Author: Thomas Tauber-Marshall <tmarshall@cloudera.com>
        Date: Fri Nov 18 14:08:55 2016 -0800

        IMPALA-4357: Fix DROP TABLE to pass analysis if the table fails to load

        If a table fails to load, eg. because it was deleted externally from
        Kudu, we should still allow 'DROP TABLE' to pass analysis. Otherwise,
        you may be unable to drop tables that are in a bad state.

        Testing:

        • Updates existing Kudu tests to reflect the new behavior, and fixes
          a couple of problems with those tests that were causing them to pass
          spuriously (as well as fixing the same problem with another test in
          the file while I'm here).

        Change-Id: I6b41fc3c0e95508ab67f1d420b033b02ec75a5da
        Reviewed-on: http://gerrit.cloudera.org:8080/5144
        Reviewed-by: Alex Behm <alex.behm@cloudera.com>
        Tested-by: Internal Jenkins

        Show
        twmarshall Thomas Tauber-Marshall added a comment - commit 7bcb51b152ac0b2e7660ec96b1ee94e5ab906abd Author: Thomas Tauber-Marshall <tmarshall@cloudera.com> Date: Fri Nov 18 14:08:55 2016 -0800 IMPALA-4357 : Fix DROP TABLE to pass analysis if the table fails to load If a table fails to load, eg. because it was deleted externally from Kudu, we should still allow 'DROP TABLE' to pass analysis. Otherwise, you may be unable to drop tables that are in a bad state. Testing: Updates existing Kudu tests to reflect the new behavior, and fixes a couple of problems with those tests that were causing them to pass spuriously (as well as fixing the same problem with another test in the file while I'm here). Change-Id: I6b41fc3c0e95508ab67f1d420b033b02ec75a5da Reviewed-on: http://gerrit.cloudera.org:8080/5144 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: Internal Jenkins

          People

          • Assignee:
            twmarshall Thomas Tauber-Marshall
            Reporter:
            mjacobs Matthew Jacobs
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development