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

[multistage] clean up transform function type #11726

Merged
merged 4 commits into from
Oct 3, 2023

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

Merging #11726 (1d29088) into master (82140f1) will decrease coverage by 48.66%.
Report is 13 commits behind head on master.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             master   #11726       +/-   ##
=============================================
- Coverage     63.08%   14.43%   -48.66%     
+ Complexity     1117      201      -916     
=============================================
  Files          2342     2342               
  Lines        125797   125889       +92     
  Branches      19336    19360       +24     
=============================================
- Hits          79358    18166    -61192     
- Misses        40785   106190    +65405     
+ Partials       5654     1533     -4121     
Flag Coverage Δ
integration ?
integration1 ?
integration2 ?
java-11 14.42% <0.00%> (-48.64%) ⬇️
java-17 14.42% <0.00%> (-48.50%) ⬇️
java-20 14.42% <0.00%> (-48.50%) ⬇️
temurin 14.43% <0.00%> (-48.66%) ⬇️
unittests 14.43% <0.00%> (-48.65%) ⬇️
unittests1 ?
unittests2 14.43% <0.00%> (-0.02%) ⬇️

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

Files Coverage Δ
.../pinot/common/function/scalar/DateTimeConvert.java 0.00% <ø> (-96.43%) ⬇️
...he/pinot/common/function/scalar/JsonFunctions.java 0.00% <ø> (-87.88%) ⬇️
...geospatial/transform/function/ScalarFunctions.java 0.00% <ø> (-86.21%) ⬇️
...inot/common/function/scalar/DateTimeFunctions.java 0.00% <0.00%> (-21.92%) ⬇️
.../pinot/sql/parsers/rewriter/CLPDecodeRewriter.java 0.00% <0.00%> (-74.25%) ⬇️
...transform/function/CLPDecodeTransformFunction.java 0.00% <0.00%> (-94.12%) ⬇️
...r/transform/function/InIdSetTransformFunction.java 0.00% <0.00%> (-38.10%) ⬇️
...core/query/executor/ServerQueryExecutorV1Impl.java 0.00% <0.00%> (-64.60%) ⬇️
...r/transform/function/TransformFunctionFactory.java 0.00% <0.00%> (-89.54%) ⬇️
...e/pinot/common/function/TransformFunctionType.java 0.00% <0.00%> (-89.33%) ⬇️

... and 1509 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@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

@walterddr walterddr merged commit 78fc66b into apache:master Oct 3, 2023
19 checks passed
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