[
https://issues.apache.org/jira/browse/IMPALA-15126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18092943#comment-18092943
]
ASF subversion and git services commented on IMPALA-15126:
----------------------------------------------------------
Commit e47134ece299ddd2d538c9017b44b383b35e9d28 in impala's branch
refs/heads/master from Zoltan Borok-Nagy
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=e47134ece ]
IMPALA-15126: Fix NullPointerException for STRUCT.* expansion on masked tables
When a table has a column-masking policy, queries are rewritten to read
from a table-masking view and re-analyzed. Expanding a struct that
contains a nested collection - via STRUCT.* or SELECT * with
EXPAND_COMPLEX_TYPES=true - built the collection's relative path with
Path.createRelPath(), which did not carry the path's table-masking
marker. The collection was therefore rooted at the underlying table's
tuple, which is registered only inside the masking view's analyzer, so
CollectionTableRef.analyze() -> Analyzer.findAnalyzer() returned null
and threw a NullPointerException.
Path.createRelPath() now propagates the pre-masking path to the derived
relative path, so a collection reached through struct expansion roots at
the masking view's tuple in the current query block (matching how
directly selected masked collections already resolve).
Testing:
- New FE test
AuthorizationStmtTest.testColumnMaskingStructWithNestedCollection
- New e2e test cases in
QueryTest/ranger_column_masking_complex_types.test
Change-Id: Id101542aed900220383481f17d812b1889f78736
Assisted-by: Claude Opus 4.8 (1M context) <[email protected]>
Reviewed-on: http://gerrit.cloudera.org:8080/24524
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> NullPointerException for STRUCT.* expansion on masked tables
> ------------------------------------------------------------
>
> Key: IMPALA-15126
> URL: https://issues.apache.org/jira/browse/IMPALA-15126
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Reporter: Zoltán Borók-Nagy
> Assignee: Zoltán Borók-Nagy
> Priority: Major
>
> When a Ranger column-masking policy is defined and a query expands a struct
> with a star path (STRUCT.*) such that the expansion includes complex
> sub-fields, analysis fails with a server-side NullPointerException.
> Steps to reproduce:
> 1. Add any column-masking policy on functional_parquet.complextypestbl for
> the requesting user (e.g. id → CUSTOM 100 * \{col}) so the table is served
> through a table-masking view.
> 2.
> {noformat}
> REFRESH AUTHORIZATION;{noformat}
> 3. As the masked user, run:
> {noformat}
> SET EXPAND_COMPLEX_TYPES=true;
> SELECT id, nested_struct.* FROM functional_parquet.complextypestbl;{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]