Dmitry Lychagin has submitted this change and it was merged. Change subject: [NO ISSUE][COMP] Refactor function lookup in expression translator ......................................................................
[NO ISSUE][COMP] Refactor function lookup in expression translator - user model changes: no - storage format changes: no - interface changes: no Details: - Move function lookup code in LangExpressionToPlanTranslator into a separate method so it can be modified by product extensions Change-Id: I917665fd631b220daa6fe7436288193b0dec60b4 Reviewed-on: https://asterix-gerrit.ics.uci.edu/3258 Integration-Tests: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> Reviewed-by: Ali Alsuliman <[email protected]> --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java 1 file changed, 11 insertions(+), 4 deletions(-) Approvals: Anon. E. Moose #1000171: Ali Alsuliman: Looks good to me, approved Jenkins: Verified; Verified Objections: Jenkins: Violations found diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java index 91de474..96773a6 100644 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java +++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java @@ -779,10 +779,8 @@ } SourceLocation sourceLoc = fcall.getSourceLocation(); - AbstractFunctionCallExpression f; - if ((f = lookupUserDefinedFunction(signature, args, sourceLoc)) == null) { - f = lookupBuiltinFunction(signature.getName(), signature.getArity(), args, sourceLoc); - } + + AbstractFunctionCallExpression f = lookupFunction(signature, args, sourceLoc); if (f == null) { throw new CompilationException(ErrorCode.UNKNOWN_FUNCTION, sourceLoc, @@ -816,6 +814,15 @@ return varRef; } + protected AbstractFunctionCallExpression lookupFunction(FunctionSignature signature, + List<Mutable<ILogicalExpression>> args, SourceLocation sourceLoc) throws CompilationException { + AbstractFunctionCallExpression f; + if ((f = lookupUserDefinedFunction(signature, args, sourceLoc)) == null) { + f = lookupBuiltinFunction(signature.getName(), signature.getArity(), args, sourceLoc); + } + return f; + } + private AbstractFunctionCallExpression lookupUserDefinedFunction(FunctionSignature signature, List<Mutable<ILogicalExpression>> args, SourceLocation sourceLoc) throws CompilationException { try { -- To view, visit https://asterix-gerrit.ics.uci.edu/3258 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: merged Gerrit-Change-Id: I917665fd631b220daa6fe7436288193b0dec60b4 Gerrit-PatchSet: 3 Gerrit-Project: asterixdb Gerrit-Branch: stabilization-f69489 Gerrit-Owner: Dmitry Lychagin <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Dmitry Lychagin <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]>
