winedepot / pinot

Apache Pinot (Incubating) - A realtime distributed OLAP datastore
https://pinot.apache.org
Apache License 2.0
1 stars 0 forks source link

Adding support for udfs in Selection #22

Closed kishoreg closed 5 years ago

kishoreg commented 5 years ago

We currently support expressions and udf's in aggregation and group by but not in selection and filters. This PR adds support for expressions in selection.

Note that with this PR, we add the support in query execution but the pql parsing does not support it. All udfs in select list are treated as aggregation functions by default. The reason is that AggregationFunctionType is in pinot-core, we will have to move it to pinot-common so that we can check for the name and decide if its a simple function vs aggregation function. Will add that in another PR.

Existing test cases passed.

codecov-io commented 5 years ago

Codecov Report

Merging #22 into develop will decrease coverage by 0.43%. The diff coverage is 8.22%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop      #22      +/-   ##
=============================================
- Coverage      65.24%   64.81%   -0.44%     
  Complexity         4        4              
=============================================
  Files           1046     1048       +2     
  Lines          54117    54397     +280     
  Branches        7708     7757      +49     
=============================================
- Hits           35307    35255      -52     
- Misses         16253    16579     +326     
- Partials        2557     2563       +6
Impacted Files Coverage Δ Complexity Δ
...inot/pql/parsers/pql2/ast/OutputColumnAstNode.java 93.54% <ø> (ø) 0 <0> (ø) :arrow_down:
...t/core/query/selection/SelectionOperatorUtils.java 93.01% <ø> (-0.03%) 0 <0> (ø)
...e/pinot/core/operator/query/SelectionOperator.java 0% <0%> (ø) 0 <0> (?)
.../operator/transform/TransformBlockDataFetcher.java 0% <0%> (ø) 0 <0> (?)
.../core/startree/plan/StarTreeTransformPlanNode.java 75% <100%> (ø) 0 <0> (ø) :arrow_down:
.../org/apache/pinot/core/plan/TransformPlanNode.java 50% <19.04%> (-24.2%) 0 <0> (ø)
.../org/apache/pinot/core/plan/SelectionPlanNode.java 48.83% <57.14%> (-12.46%) 0 <0> (ø)
...not/core/operator/transform/TransformOperator.java 90.47% <80%> (-3.97%) 0 <0> (ø)
...er/validation/BrokerResourceValidationManager.java 50% <0%> (-31.25%) 0% <0%> (ø)
...he/pinot/core/query/pruner/ValidSegmentPruner.java 57.14% <0%> (-28.58%) 0% <0%> (ø)
... and 36 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 89aa228...b4defa8. Read the comment docs.