Quanlong Huang has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/17888


Change subject: IMPALA-10936: Fix NPE in collecting policy tables on 
FailedLoadLocalTable
......................................................................

IMPALA-10936: Fix NPE in collecting policy tables on FailedLoadLocalTable

Ranger column-masking/row-filtering policies can have complex
expressions that reference other tables (e.g. by using subqueries). So
when loading metadata of a table, we also need to load all tables
referenced by its related policies (i.e. "policy tables"). This requires
getting all its columns so we can get the column-masking policies.
However, for a failed loaded table in LocalCatalog mode, the table is
represented by a FailedLoadLocalTable which has a null ColumnMap. This
causes a NullPointerException when collecting policy tables for it.

This patch skips collecting policy tables on failed loaded tables. Also
add some null checks in LocalTable in case its ColumnMap is null. So
FailedLoadLocalTable can have the same robustness as IncompleteTable
which is the failed table representation in the legacy catalog mode.

Tests:
 - Manually verified the NPE disappear in logs
 - Added FE unit test

Change-Id: I7a6cd567685920211f05f2fdaac96bc98da41ac6
---
M fe/src/main/java/org/apache/impala/analysis/StmtMetadataLoader.java
M fe/src/main/java/org/apache/impala/catalog/local/LocalTable.java
M fe/src/test/java/org/apache/impala/analysis/StmtMetadataLoaderTest.java
3 files changed, 40 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/88/17888/1
--
To view, visit http://gerrit.cloudera.org:8080/17888
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a6cd567685920211f05f2fdaac96bc98da41ac6
Gerrit-Change-Number: 17888
Gerrit-PatchSet: 1
Gerrit-Owner: Quanlong Huang <[email protected]>

Reply via email to