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

Clean up AggregationFunctionContext and use TransformExpressionTree as the key in the blockValSetMap passed to the AggregationFunctions #5364

Merged
merged 2 commits into from
May 12, 2020

Commits on May 12, 2020

  1. Clean up AggregationFunctionContext and use TransformExpressionTree a…

    …s the key in the blockValSetMap passed to the AggregationFunctions
    
    - Clean up all the usage of AggregationFunctionContext to directly use AggregationFunction
    - Construct the AggregationFunctions and Group-by Expressions at planning phase and pass them to Operator and Executor to save the extra expression compilation
    - Use TransformExpressionTree as the key in the blockValSetMap passed to the AggregationFunctions
      - The benefit of this is to save the redundant string conversion, and more efficient hashCode() and equals()
      - The keys of the blockValSetMap should be the same as AggregationFunction.getInputExpressions()
      - The only exception is CountAggregationFunction with Star-Tree where there is a single entry in blockValSetMap (column "*")
    - Add base implementation of AggregationFunction: BaseSingleExpressionAggregationFunction for aggregation functions on single expressions
    - For PERCENTILE group aggregation functions, support using the second arguments to pass in percentile (e.g. PERCENTILE(column, 99), PERCENTILETDIGEST(column, 90))
    - Enhance Star-Tree Aggregation/Group-by Executor to handle the column name conversion so that AggregationFunctionColumnPair is transparent to the AggregationFunction
    
    BACKWARD-INCOMPATIBLE CHANGE:
    The following APIs are changed in AggregationFunction (use TransformExpressionTree instead of String as the key of blockValSetMap):
    void aggregate(int length, AggregationResultHolder aggregationResultHolder, Map<TransformExpressionTree, BlockValSet> blockValSetMap);
    void aggregateGroupBySV(int length, int[] groupKeyArray, GroupByResultHolder groupByResultHolder, Map<TransformExpressionTree, BlockValSet> blockValSetMap);
    void aggregateGroupByMV(int length, int[][] groupKeysArray, GroupByResultHolder groupByResultHolder, Map<TransformExpressionTree, BlockValSet> blockValSetMap);
    Jackie-Jiang committed May 12, 2020
    Configuration menu
    Copy the full SHA
    e2b366d View commit details
    Browse the repository at this point in the history
  2. minor change

    Jackie-Jiang committed May 12, 2020
    Configuration menu
    Copy the full SHA
    406f938 View commit details
    Browse the repository at this point in the history