[
https://issues.apache.org/jira/browse/IMPALA-9625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17082468#comment-17082468
]
ASF subversion and git services commented on IMPALA-9625:
---------------------------------------------------------
Commit e93405f7600c2cefcf522fdc64162a9ceaac3aa3 in impala's branch
refs/heads/master from Fang-Yu Rao
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=e93405f ]
IMPALA-9625: Convert the name of a TAccessEvent to lowercase
Impala's COMPUTE STATS statement results in two registrations of the
ALTER event for the corresponding table identified by its
fully-qualified table name and a Set is used to maintained the audits.
The first registration is in Analyzer#registerAuthAndAuditEvent() and
the second is in Analyzer#getTable().
In registerAuthAndAuditEvent(), the corresponding full table name
table.getFullName() is produced by a call to Analyzer#resolveTableRef().
The resulting database and table names are both in lowercase.
However, in getTable(), the fully-qualified table name is produced by a
call to Analyzer#getFqTableName(). 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 names from registerAuthAndAuditEvent()
and getTable() would differ, resulting in duplicate ALTER events for the
same table. This patch resolves the inconsistencies by converting the
name of a TAccessEvent to lowercase in addAccessEvent(), which is called
in getTable().
Testing:
- Revised a FE test to verified we do not have duplicate ALTER events for
the COMPUTE STATS statement.
- Verified that the patch passes the exhaustive tests in the DEBUG build
except for a flaky E2E test of test_column_storage_attributes.
Change-Id: If0d9ba58da891921fafbfe7c6db358b51965e178
Reviewed-on: http://gerrit.cloudera.org:8080/15689
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> 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
> Priority: Critical
>
> 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)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]