[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:
qiye
2022-01-25 22:28:05 +08:00
committed by GitHub
parent a6831535e9
commit 461b352d3e
8 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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);