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

Impala's COMPUTE STATS statement generates duplicate ALTER events

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • None
    • Frontend
    • None

    Description

      Impala's COMPUTE STATS statement results in the registration of the ALTER event twice. One is in Analyzer#registerAuthAndAuditEvent() at https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/analysis/Analyzer.java#L3131-L3133 and the other is in Analyzer#getTable() at https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/analysis/Analyzer.java#L2862-L2863.

      In registerAuthAndAuditEvent(), the corresponding full table name table.getFullName() is produced by a call to Analyzer#resolveTableRef() (https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/analysis/ComputeStatsStmt.java#L352). The resulting database and table names are both in lowercase.

      However, in getTable(), the fully-qualified table name is produce by a call to Analyzer#getFqTableName() at https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/analysis/Analyzer.java#L2836. The resulting database and table names are in their originally unconverted form provided by the user from the Impala shell. Hence, there is no guarantee that the database and table names are both in lowercase.

      Therefore, if a user does not provide lowercase database and table names, the returned full table name from registerAuthAndAuditEvent() and getTable() would differ, resulting in duplicate ALTER events for the same table.

      We should at least make the full table name consistent every time when we register such an audit event to avoid duplicate entries in the log.

       

      Attachments

        Issue Links

          Activity

            People

              fangyurao Fang-Yu Rao
              fangyurao Fang-Yu Rao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: