-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native] Add support for REST based remote function #23568
base: master
Are you sure you want to change the base?
Conversation
808f416
to
1c7ea23
Compare
86c1f8b
to
3345b51
Compare
0d73f09
to
f530b51
Compare
32a8715
to
5726f00
Compare
a8afff9
to
26f9fe6
Compare
29ef0bb
to
c2ca02c
Compare
d1d0703
to
83ecc48
Compare
@aditi-pandit Can you please review the changes |
ef746fc
to
098b074
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Joe-Abraham, could you add e2e tests as well?
@@ -18,12 +18,20 @@ add_library( | |||
presto_types OBJECT | |||
PrestoToVeloxQueryPlan.cpp PrestoToVeloxExpr.cpp VeloxPlanValidator.cpp | |||
PrestoToVeloxSplit.cpp PrestoToVeloxConnector.cpp) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: revert newline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted the line
@@ -412,6 +421,18 @@ std::optional<TypedExprPtr> VeloxExprConverter::tryConvertLike( | |||
returnType, args, getFunctionName(signature)); | |||
} | |||
|
|||
#ifdef PRESTO_ENABLE_REMOTE_FUNCTIONS | |||
PageFormat fromSerdeString(const std::string_view& serdeName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this as a separate function? There is only one caller and this check can be moved to the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved it to the function
@@ -412,6 +421,18 @@ std::optional<TypedExprPtr> VeloxExprConverter::tryConvertLike( | |||
returnType, args, getFunctionName(signature)); | |||
} | |||
|
|||
#ifdef PRESTO_ENABLE_REMOTE_FUNCTIONS | |||
PageFormat fromSerdeString(const std::string_view& serdeName) { | |||
if (serdeName == "presto_page") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid magic literal and use constant variable for "presto_page"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation is done similar to the below code.
if (serdeName == "presto_page") { |
return std::make_shared<CallTypedExpr>( | ||
returnType, args, getFunctionName(sqlFunctionHandle->functionId)); | ||
} | ||
#ifdef PRESTO_ENABLE_REMOTE_FUNCTIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this logic to a separate function, say registerVeloxRemoteFunction
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback, I have made the improvements
}; | ||
class ParseError : public Exception { | ||
public: | ||
explicit ParseError(const std::string& message) : Exception(message){}; | ||
explicit ParseError(const std::string& message) : Exception(message) {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Revert these changes. I believe these format-fixes were automatically added on Macos? They would likely cause a failure in format-check CI which runs on linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are auto-generated, I have reverted these changes.
@@ -175,7 +175,7 @@ AbstractClasses: | |||
subclasses: | |||
- { name: BuiltInFunctionHandle, key: $static } | |||
- { name: SqlFunctionHandle, key: json_file } | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: revert this newline removal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted back the changes, Is there a need of two empty line?
@@ -74,6 +74,16 @@ target_link_libraries( | |||
${GFLAGS_LIBRARIES} | |||
pthread) | |||
|
|||
if(PRESTO_ENABLE_REMOTE_FUNCTIONS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed? No tests have been added for remote functions so could this be reverted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added these as part of build failure in MacOS, removed it.
2024364
to
6af6ddb
Compare
Co-authored-by: Wills Feng <[email protected]>
Description
Dependency