Skip to content

Conversation

@walterddr
Copy link
Contributor

@walterddr walterddr commented Oct 2, 2023

registration of the transform function is not complete with _ separate and camelCase naming.

  • making the list of transform function complete
  • making sure there's a scalar function equivalent (or explicitly document when there's not)
  • add function registration test

TODO: add tests to pinot-query-runtime (separate b/c there are bug fixes required)

CC @xiangfu0 @Jackie-Jiang

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2023

Codecov Report

❌ Patch coverage is 90.76923% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.08%. Comparing base (82140f1) to head (1d29088).
⚠️ Report is 3295 commits behind head on master.

Files with missing lines Patch % Lines
...e/pinot/common/function/TransformFunctionType.java 93.33% 1 Missing and 2 partials ⚠️
...transform/function/CLPDecodeTransformFunction.java 0.00% 1 Missing ⚠️
...r/transform/function/InIdSetTransformFunction.java 0.00% 1 Missing ⚠️
...core/query/executor/ServerQueryExecutorV1Impl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #11726   +/-   ##
=========================================
  Coverage     63.08%   63.08%           
  Complexity     1117     1117           
=========================================
  Files          2342     2342           
  Lines        125797   125889   +92     
  Branches      19336    19360   +24     
=========================================
+ Hits          79358    79419   +61     
- Misses        40785    40817   +32     
+ Partials       5654     5653    -1     
Flag Coverage Δ
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 63.05% <90.76%> (-0.01%) ⬇️
java-17 62.94% <90.76%> (+0.02%) ⬆️
java-20 62.95% <90.76%> (+0.04%) ⬆️
temurin 63.08% <90.76%> (+<0.01%) ⬆️
unittests 63.08% <90.76%> (+<0.01%) ⬆️
unittests1 67.24% <90.76%> (+<0.01%) ⬆️
unittests2 14.43% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@walterddr walterddr force-pushed the pr_clean_up_transform_scalar branch from db184f3 to 0d9a304 Compare October 2, 2023 23:31
@walterddr walterddr marked this pull request as ready for review October 3, 2023 16:42
@walterddr walterddr changed the title [multistage] clean up transform function type (draft) [multistage] clean up transform function type Oct 3, 2023
"arraylength", "arrayaverage", "arraymin", "arraymax", "arraysum",
"valuein", "mapvalue", "inidset", "lookup", "groovy",
"timeconvert", "datetimeconvert", "jsonextractscalar", "jsonextractkey", "clpdecode",
"arraylength", "arrayaverage", "arraymin", "arraymax", "arraysum", "clpdecode", "groovy",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

other than the ignored list here, all other functions (including their alternative naming are registered in FunctionRegistry (e.g. has correspondent in ScalarFunction impl)

NOT_EQUALS("not_equals"),
GREATER_THAN("greater_than"),
GREATER_THAN_OR_EQUAL("greater_than_or_equal"),
NOT_EQUALS("not_equals", "notEquals"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need these aliases for auto-generated functions? If so, why skipping LESS_THAN and NOT_IN?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol good catch. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

technically we dont need any of these. but we already have ComparisonFunctions in scalar with these names so added lessThan but not notIn b/c we dont have that

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not the correct way to decide whether to add them though. Eventually we need scalar function for all of them, but that is orthogonal to this problem.
Does postgreSQL support these functions? If so, we need to add them, if not, we should not add them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So 2 options. Either we allow underscore on both scalar and transform. Or we don't allow them in neither.

Problem is that transform function in v1 allows underscore so for backward compatibility we need to register them. It is not about syntax.

For syntax sake we should not allow underscore format all together.

Copy link
Contributor Author

@walterddr walterddr Oct 3, 2023

Choose a reason for hiding this comment

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

discussed offline. will remove these in separate PR as we should not allow these function explicitly being called. They are not consider SqlFunction but SqlOperators to begin with

due to the fact that we do allow these already in release 1.0, we will use a separate PR to deprecate them explicitly with backward-incompat flag

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see #11734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants