Fang-Yu Rao created IMPALA-9625:
-----------------------------------
Summary: Impala's COMPUTE STATS statement generates duplicate
ALTER events
Key: IMPALA-9625
URL: https://issues.apache.org/jira/browse/IMPALA-9625
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Fang-Yu Rao
Assignee: Fang-Yu Rao
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)