-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(fuzzer): Add custom special form signatures for Presto and Spark #12032
Conversation
✅ Deploy Preview for meta-velox canceled.
|
Hi @kagamiori, would you like to take a review on this fuzzer change? Thanks! |
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.
CMake 👍
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.
Hi @rui-mo, thank you for refactoring the fuzzer for better support of special forms across different engines. It looks good to me except a few nits about the comments.
@@ -34,6 +35,7 @@ using facebook::velox::exec::test::ExprTransformer; | |||
/// FuzzerRunner leverages ExpressionFuzzerVerifier to create a gtest unit test. | |||
class FuzzerRunner { | |||
public: | |||
// @param signatureGenerator Generates valid signatures for special forms. |
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: use /// instead of //
|
||
// @param signatureGenerator Generates valid signatures for special forms. |
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.
Ditto.
|
||
std::vector<exec::FunctionSignaturePtr> | ||
SparkSpecialFormSignatureGenerator::getSignaturesForConcatWs() const { | ||
return {// Signature: concat_ws (separator, input, ...) -> output: |
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: Put comment in an separate line.
|
||
std::vector<exec::FunctionSignaturePtr> | ||
SpecialFormSignatureGenerator::getSignaturesForAnd() const { | ||
return {// Signature: and (condition,...) -> output: |
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.
Ditto.
public: | ||
virtual ~SpecialFormSignatureGenerator() {} | ||
|
||
/// Generates valid signatures for special forms and append to the signature |
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: Generates valid signatures for the specified special forms and append them to the signature map. specialForms specifies a list of special form names delimited by comma.
|
||
protected: | ||
/// Generates signatures for cast from integral types to the given type and | ||
/// adds to input vector. |
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: ... and add them to signatures? Same for the other comments below.
@kagamiori has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@kagamiori merged this pull request in 8817013. |
@kagamiori Thanks for helping review! |
The signatures of special forms used in the expression fuzzer are different
between Presto and Spark. This PR adds 'SpecialFormSignatureGenerator' and
'SparkSpecialFormSignatureGenerator' for Presto and Spark respectively. Custom
signatures for Spark cast and concat_ws function were added.