Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
-
ghx-label-3
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
- relates to
-
IMPALA-11271 Impala generating two audits for "Compute stats" query when the database name is in mixed case
- Open