-
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
Allow marking an argument as constant in the simple function API #7901
Conversation
✅ Deploy Preview for meta-velox canceled.
|
Hello @laithsakka and @mbasmanova , could you please help review this PR? |
@laithsakka gentle ping |
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.
thank looks good mostly , just some questions and nits
also would it make sense to make
arg_type<Constant> works by translating it to arg_type
@@ -85,7 +85,7 @@ TEST_F(SimpleFunctionInitTest, initializationArray) { | |||
NonDefaultWithArrayInitFunction, | |||
Array<int32_t>, | |||
int32_t, | |||
Array<int32_t>>({"non_default_behavior_with_init"}); | |||
Constant<Array<int32_t>>>({"non_default_behavior_with_init"}); |
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 are we changing those?
I see NonDefaultWithArrayInitFunction does handles non constant arrays
if (second == nullptr) {
return;
}
question, what is the effect of marking an argument as constant in 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.
why are we changing those? I see NonDefaultWithArrayInitFunction does handles non constant arrays
I thought the second argument is only handled in initialize
function, so it should be marked as constant argument. But, yes, it can handle non constant arrays, I revert this change.
question, what is the effect of marking an argument as constant in the signature.
Constant argument now is only checked in Fuzzer. If one argument is marked as constant, only constant inputs are generated for it by Fuzzer.
#3995 (comment)
void initialize( | ||
const core::QueryConfig& /*config*/, | ||
const arg_type<int32_t>* /*first*/, | ||
const arg_type<int32_t>* second, |
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.
this will cause lint errors remove names of unsed variables.
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.
Updated, thanks.
out_type<int64_t>& out, | ||
const arg_type<int32_t>* first, | ||
const arg_type<int32_t>* /*second*/, | ||
const arg_type<Varchar>* /*third*/, |
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
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.
Updated, thanks.
1075f92
to
60eff16
Compare
Looks test failure is not related to this change.
|
60eff16
to
d882788
Compare
@zhli1142015 I think you might have missed my comment about handling ex: if a user used call(..arg_type<Constant>, to have that work, i think now that would just not compile, |
@laithsakka has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Thanks for reviewing this change and sorry for missing that comment. I want to confirm if I corrrectly understand this problem, do you mean if customers define a custom type named "constant" and use it in simplme function API, we should support it? |
d882788
to
aa2e3f2
Compare
@laithsakka merged this pull request in 9d7d4e8. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Fixes #7877