[ 
https://issues.apache.org/jira/browse/IMPALA-14875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18070497#comment-18070497
 ] 

Fang-Yu Rao edited comment on IMPALA-14875 at 4/2/26 6:04 AM:
--------------------------------------------------------------

We hit the Preconditions check at 
[https://github.com/apache/impala/blob/ca5c8e0/fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java#L180].
{code:java}
      for (Map.Entry<String, List<PrivilegeRequest>> entry : 
columnPrivReqs.entrySet()) {
        List<PrivilegeRequest> privReqs = tablePrivReqs.get(entry.getKey());
        Preconditions.checkState(privReqs != null); // We hit the Preconditions 
check here.
        privReqs.addAll(entry.getValue());
      }
{code}
 

What I found was that the table names in {{columnPrivReqs}} and 
{{tablePrivReqs}} for the same table could be different. In the provided 
example in the description, the key of the former would be 
"{{test_db_100.employee_A}}" and the latter would be 
"{{{}test_db_100.employee_a{}}}". Due to this, {{privReqs}} becomes null. 
[https://gerrit.cloudera.org/c/24165/] is a potential fix. I will take a closer 
look at it to see if there are other issues.


was (Author: fangyurao):
We hit the Preconditions check at 
[https://github.com/apache/impala/blob/ca5c8e0/fe/src/main/java/org/apache/impala/authorization/BaseAuthorizationChecker.java#L180].
{code:java}
      for (Map.Entry<String, List<PrivilegeRequest>> entry : 
columnPrivReqs.entrySet()) {
        List<PrivilegeRequest> privReqs = tablePrivReqs.get(entry.getKey());
        Preconditions.checkState(privReqs != null); // We hit the Preconditions 
check here.
        privReqs.addAll(entry.getValue());
      }
{code}
 

What I found was that the table names in {{columnPrivReqs}} and 
{{tablePrivReqs}} for the same table could be different. In the provided 
example in the description, the key of the former would be 
{{test_db_100.employee_A}} and the latter would be 
{{{}test_db_100.employee_a{}}}. Due to this, {{privReqs}} becomes null. 
[https://gerrit.cloudera.org/c/24165/] is a potential fix. I will take a closer 
look at it to see if there are other issues.

> CREATE TABLE AS SELECT could fail a Preconditions check added in IMPALA-14507
> -----------------------------------------------------------------------------
>
>                 Key: IMPALA-14875
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14875
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Fang-Yu Rao
>            Assignee: Fang-Yu Rao
>            Priority: Major
>              Labels: broken-build
>
> We found that CREATE TABLE AS SELECT could fail a Preconditions check added 
> in IMPALA-14507. We could reproduce the issue by executing the following in 
> impala-shell.
> - create database test_db_100.
> - create database config_ueeevc.
> - CREATE EXTERNAL TABLE config_ueeevc.employee (emp_id INT, name STRING, 
> start_date DATE, quit_date DATE, quit_flag STRING) STORED AS PARQUET 
> TBLPROPERTIES ('OBJCAPABILITIES'='EXTREAD,EXTWRITE', 
> 'TRANSLATED_TO_EXTERNAL'='TRUE', 'external.table.purge'='TRUE').
> - CREATE TABLE test_db_100.employee_A STORED AS PARQUET 
> TBLPROPERTIES('transactional'='false') AS SELECT * FROM 
> config_ueeevc.employee;
> Query: CREATE TABLE test_db_100.employee_A STORED AS PARQUET 
> TBLPROPERTIES('transactional'='false') AS SELECT * FROM 
> config_ueeevc.employee.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to