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

StmtMetadataLoader::collectPolicyTables() should handle FailedLoadLocalTable without NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 4.0.0
    • Impala 4.1.0, Impala 4.0.1
    • Frontend
    • None
    • ghx-label-13

    Description

      If table loading fails, then it result in a FailedLoadLocalTable, which uses this constructor for LocalTable:

        protected LocalTable(LocalDb db, String tblName) {
          this.db_ = Preconditions.checkNotNull(db);
          this.name_ = tblName;
          this.ref_ = null;
          this.msTable_ = null;
          this.cols_ = null;
          this.tableStats_ = null;
        }

      Since cols_ and other fields are null, the code in StmtMetadataLoader::collectPolicyTables(), which calls LocalTable::getColumnsInHiveOrder() will throw a NullPointerException when trying to access cols_ in getNonClusteringColumns(). 

      This will fail the query with a NullPointerException, even though the underlying problem came from failing to load the table metadata. We should handle this to avoid the NullPointerException. That may happen as part of StmtMetadataLoader::collectPolicyTables() or StmtMetadataLoader::getMissingTables().

      Attachments

        Issue Links

          Activity

            People

              stigahuang Quanlong Huang
              joemcdonnell Joe McDonnell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: