Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

rui-mo
Copy link
Collaborator

@rui-mo rui-mo commented Jan 7, 2025

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.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 7, 2025
Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit b1ea71f
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67808d313ef931000852bcbe

@rui-mo rui-mo changed the title Add custom cast signatures for Presto and Spark feat: Add custom special forma signatures for Presto and Spark Jan 7, 2025
@rui-mo
Copy link
Collaborator Author

rui-mo commented Jan 7, 2025

Hi @kagamiori, would you like to take a review on this fuzzer change? Thanks!

@rui-mo rui-mo changed the title feat: Add custom special forma signatures for Presto and Spark feat: Add custom special form signatures for Presto and Spark Jan 7, 2025
Copy link
Collaborator

@assignUser assignUser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake 👍

@rui-mo rui-mo changed the title feat: Add custom special form signatures for Presto and Spark feat(fuzzer): Add custom special form signatures for Presto and Spark Jan 8, 2025
Copy link
Contributor

@kagamiori kagamiori left a 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.
Copy link
Contributor

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.
Copy link
Contributor

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:
Copy link
Contributor

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:
Copy link
Contributor

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
Copy link
Contributor

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.
Copy link
Contributor

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.

@facebook-github-bot
Copy link
Contributor

@kagamiori has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@kagamiori merged this pull request in 8817013.

@rui-mo
Copy link
Collaborator Author

rui-mo commented Jan 16, 2025

@kagamiori Thanks for helping review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants