[ https://issues.apache.org/jira/browse/DRILL-7117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16804400#comment-16804400 ]
ASF GitHub Bot commented on DRILL-7117: --------------------------------------- amansinha100 commented on pull request #1715: DRILL-7117: Support creation of equi-depth histogram for selected dat… URL: https://github.com/apache/drill/pull/1715#discussion_r270230184 ########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/TDigestFunctions.java ########## @@ -0,0 +1,1126 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.drill.exec.expr.fn.impl; + +import io.netty.buffer.DrillBuf; +import org.apache.drill.exec.expr.DrillAggFunc; +import org.apache.drill.exec.expr.DrillSimpleFunc; +import org.apache.drill.exec.expr.annotations.FunctionTemplate; +import org.apache.drill.exec.expr.annotations.FunctionTemplate.FunctionScope; +import org.apache.drill.exec.expr.annotations.FunctionTemplate.NullHandling; +import org.apache.drill.exec.expr.annotations.Output; +import org.apache.drill.exec.expr.annotations.Param; +import org.apache.drill.exec.expr.annotations.Workspace; +import org.apache.drill.exec.expr.holders.BigIntHolder; +import org.apache.drill.exec.expr.holders.NullableBigIntHolder; +import org.apache.drill.exec.expr.holders.BitHolder; +import org.apache.drill.exec.expr.holders.NullableBitHolder; +import org.apache.drill.exec.expr.holders.NullableIntHolder; +import org.apache.drill.exec.expr.holders.NullableFloat8Holder; +import org.apache.drill.exec.expr.holders.NullableFloat4Holder; +import org.apache.drill.exec.expr.holders.Float8Holder; +import org.apache.drill.exec.expr.holders.Float4Holder; +import org.apache.drill.exec.expr.holders.DateHolder; +import org.apache.drill.exec.expr.holders.TimeHolder; +import org.apache.drill.exec.expr.holders.TimeStampHolder; +import org.apache.drill.exec.expr.holders.NullableDateHolder; +import org.apache.drill.exec.expr.holders.NullableTimeHolder; +import org.apache.drill.exec.expr.holders.NullableTimeStampHolder; +import org.apache.drill.exec.expr.holders.ObjectHolder; +import org.apache.drill.exec.expr.holders.IntHolder; +import org.apache.drill.exec.expr.holders.NullableVarBinaryHolder; +import org.apache.drill.exec.expr.holders.VarCharHolder; +import org.apache.drill.exec.expr.holders.VarBinaryHolder; +import org.apache.drill.exec.expr.holders.NullableVarCharHolder; +import org.apache.drill.exec.server.options.OptionManager; +import org.apache.drill.exec.vector.AllocationHelper; +import org.apache.drill.exec.vector.RepeatedFloat8Vector; + +import javax.inject.Inject; + +@SuppressWarnings("unused") +public class TDigestFunctions { + static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TDigestFunctions.class); + + private TDigestFunctions(){} + + @FunctionTemplate(name = "tdigest", scope = FunctionTemplate.FunctionScope.POINT_AGGREGATE) + public static class BigIntTDigestFunction implements DrillAggFunc { + @Param BigIntHolder in; + @Workspace ObjectHolder work; + @Output NullableVarBinaryHolder out; + @Inject DrillBuf buffer; Review comment: The `buffer` is being used in the output() method below. ---------------------------------------------------------------- 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 > Support creation of histograms for numeric data types (except Decimal) and > date/time/timestamp > ---------------------------------------------------------------------------------------------- > > Key: DRILL-7117 > URL: https://issues.apache.org/jira/browse/DRILL-7117 > Project: Apache Drill > Issue Type: Sub-task > Components: Query Planning & Optimization > Reporter: Aman Sinha > Assignee: Aman Sinha > Priority: Major > Fix For: 1.16.0 > > > This JIRA is specific to creating histograms for numeric data types: INT, > BIGINT, FLOAT4, FLOAT8 and their corresponding nullable/non-nullable > versions. Additionally, since DATE/TIME/TIMESTAMP are internally stored as > longs, we should allow the same numeric type histogram creation for these > data types as well. -- This message was sent by Atlassian JIRA (v7.6.3#76005)