You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Quanlong Huang (Jira)" <ji...@apache.org> on 2020/12/10 07:49:00 UTC

[jira] [Created] (IMPALA-10387) Implement missing overloads of mask functions used in Ranger default masking policies

Quanlong Huang created IMPALA-10387:
---------------------------------------

             Summary: Implement missing overloads of mask functions used in Ranger default masking policies
                 Key: IMPALA-10387
                 URL: https://issues.apache.org/jira/browse/IMPALA-10387
             Project: IMPALA
          Issue Type: New Feature
            Reporter: Quanlong Huang


Some meaningless overloads of the mask functions are not implemented in Impala since Hive always returns NULL on them. It's expected to use the mask_null function (Nullify policy) directly.

However, it's common for users to configure Redact policy (mask) on all columns. If there are float/double/decimal columns, they will hit errors like this in Impala:
{code:java}
I1208 22:38:03.880369  8354 jni-util.cc:288] b8461c997916681b:83957ca300000000] org.apache.impala.common.AnalysisException: No matching function with signature: mask(FLOAT).
        at org.apache.impala.analysis.FunctionCallExpr.analyzeImpl(FunctionCallExpr.java:555)
        at org.apache.impala.analysis.Expr.analyze(Expr.java:438)
        at org.apache.impala.analysis.Expr.analyze(Expr.java:432)
        at org.apache.impala.analysis.SelectStmt$SelectAnalyzer.analyzeSelectClause(SelectStmt.java:276)
        at org.apache.impala.analysis.SelectStmt$SelectAnalyzer.analyze(SelectStmt.java:215)
        at org.apache.impala.analysis.SelectStmt$SelectAnalyzer.access$100(SelectStmt.java:199)
        at org.apache.impala.analysis.SelectStmt.analyze(SelectStmt.java:192)
        at org.apache.impala.analysis.InlineViewRef.analyze(InlineViewRef.java:218)
        at org.apache.impala.analysis.FromClause.analyze(FromClause.java:78)
        at org.apache.impala.analysis.SelectStmt$SelectAnalyzer.analyze(SelectStmt.java:213)
        at org.apache.impala.analysis.SelectStmt$SelectAnalyzer.access$100(SelectStmt.java:199)
        at org.apache.impala.analysis.SelectStmt.analyze(SelectStmt.java:192)
        at org.apache.impala.analysis.AnalysisContext.analyze(AnalysisContext.java:473)
        at org.apache.impala.analysis.AnalysisContext.analyzeAndAuthorize(AnalysisContext.java:437)
        at org.apache.impala.service.Frontend.doCreateExecRequest(Frontend.java:1530)
        at org.apache.impala.service.Frontend.getTExecRequest(Frontend.java:1497)
        at org.apache.impala.service.Frontend.createExecRequest(Frontend.java:1467)
        at org.apache.impala.service.JniFrontend.createExecRequest(JniFrontend.java:154) {code}

We'd better add these overloads to avoid hitting such errors in simple setup. These patterns are used by Ranger default masking policies:
* mask(col)
* mask_show_last_n(col, 4, 'x', 'x', 'x', -1, '1')
* mask_show_first_n(col, 4, 'x', 'x', 'x', -1, '1')
* mask_hash(col)
* mask(col, 'x', 'x', 'x', -1, '1', 1, 0, -1)

We should have overloads for {{col}} to be any types.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)