[ https://issues.apache.org/jira/browse/HIVE-23030?focusedWorklogId=411142&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-411142 ]
ASF GitHub Bot logged work on HIVE-23030: ----------------------------------------- Author: ASF GitHub Bot Created on: 27/Mar/20 15:28 Start Date: 27/Mar/20 15:28 Worklog Time Spent: 10m Work Description: jcamachor commented on pull request #960: HIVE-23030 ds rollup union URL: https://github.com/apache/hive/pull/960#discussion_r399347796 ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/DataSketchesFunctions.java ########## @@ -53,169 +73,278 @@ private static final String SKETCH_TO_VARIANCES = "variances"; private static final String SKETCH_TO_PERCENTILE = "percentile"; - private final Registry system; + private final List<SketchDescriptor> sketchClasses; + private final ArrayList<UDFDescriptor> descriptors; + + DataSketchesFunctions() { + this.sketchClasses = new ArrayList<SketchDescriptor>(); + this.descriptors = new ArrayList<HiveUDFPlugin.UDFDescriptor>(); + registerHll(); + registerCpc(); + registerKll(); + registerTheta(); + registerTuple(); + registerQuantiles(); + registerFrequencies(); + + buildCalciteFns(); + buildDescritors(); + } + + @Override + public Iterable<UDFDescriptor> getDescriptors() { + return descriptors; + } - public DataSketchesFunctions(Registry system) { - this.system = system; + private void buildDescritors() { + for (SketchDescriptor sketchDescriptor : sketchClasses) { + descriptors.addAll(sketchDescriptor.fnMap.values()); + } } - public static void register(Registry system) { - DataSketchesFunctions dsf = new DataSketchesFunctions(system); - String prefix = "ds"; - dsf.registerHll(prefix); - dsf.registerCpc(prefix); - dsf.registerKll(prefix); - dsf.registerTheta(prefix); - dsf.registerTuple(prefix); - dsf.registerQuantiles(prefix); - dsf.registerFrequencies(prefix); + private void buildCalciteFns() { + for (SketchDescriptor sd : sketchClasses) { + // Mergability is exposed to Calcite; which enables to use it during rollup. + Review comment: nit. \n ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 411142) Time Spent: 3h 40m (was: 3.5h) > Enable sketch union-s to be rolled up > ------------------------------------- > > Key: HIVE-23030 > URL: https://issues.apache.org/jira/browse/HIVE-23030 > Project: Hive > Issue Type: Sub-task > Reporter: Zoltan Haindrich > Assignee: Zoltan Haindrich > Priority: Major > Labels: pull-request-available > Attachments: HIVE-23030.01.patch, HIVE-23030.02.patch, > HIVE-23030.03.patch, HIVE-23030.04.patch, HIVE-23030.04.patch > > Time Spent: 3h 40m > Remaining Estimate: 0h > > Enabling rolling up sketch aggregates could enable the matching of > materialized views created for higher dimensions to be applied for lower > dimension cases. -- This message was sent by Atlassian Jira (v8.3.4#803005)