[fix](function) Change digital_masking function arg type to BIGINT (#7888)
Change digital_masking function arg type to BIGINT to fix the wrong result.
This commit is contained in:
@ -88,7 +88,7 @@ public class AliasFunction extends Function {
|
||||
/**
|
||||
* Please ensure that the condition checks in {@link #analyze} are satisfied
|
||||
*/
|
||||
functionSet.addBuiltin(createBuiltin(DIGITAL_MASKING, Lists.newArrayList(Type.INT), Type.VARCHAR,
|
||||
functionSet.addBuiltin(createBuiltin(DIGITAL_MASKING, Lists.newArrayList(Type.BIGINT), Type.VARCHAR,
|
||||
false, Lists.newArrayList("id"), getExpr(oriStmt), true));
|
||||
} catch (AnalysisException e) {
|
||||
LOG.error("Add builtin alias function error {}", e);
|
||||
|
||||
@ -120,7 +120,7 @@ public class CreateFunctionTest {
|
||||
Assert.assertTrue(constExprLists.get(0).get(0) instanceof FunctionCallExpr);
|
||||
|
||||
// create alias function
|
||||
createFuncStr = "create alias function db1.id_masking(int) with parameter(id) as concat(left(id,3),'****',right(id,4));";
|
||||
createFuncStr = "create alias function db1.id_masking(bigint) with parameter(id) as concat(left(id,3),'****',right(id,4));";
|
||||
createFunctionStmt = (CreateFunctionStmt) UtFrameUtils.parseAndAnalyzeStmt(createFuncStr, ctx);
|
||||
Catalog.getCurrentCatalog().createFunction(createFunctionStmt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user