[
https://issues.apache.org/jira/browse/DRILL-6094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16452470#comment-16452470
]
ASF GitHub Bot commented on DRILL-6094:
---------------------------------------
Github user vvysotskyi commented on a diff in the pull request:
https://github.com/apache/drill/pull/1232#discussion_r184007677
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/Hash64WithSeedAsDouble.java
---
@@ -265,6 +268,42 @@ public void eval() {
}
}
+ @FunctionTemplate(name = "hash64AsDouble", scope = FunctionScope.SIMPLE,
nulls = FunctionTemplate.NullHandling.INTERNAL)
+ public static class VarDecimalHash implements DrillSimpleFunc {
+ @Param VarDecimalHolder in;
+ @Param BigIntHolder seed;
+ @Output BigIntHolder out;
+
+ public void setup() {
+ }
+
+ public void eval() {
+ java.math.BigDecimal input =
org.apache.drill.exec.util.DecimalUtility.getBigDecimalFromDrillBuf(in.buffer,
+ in.start, in.end - in.start, in.scale);
+ out.value =
org.apache.drill.exec.expr.fn.impl.HashHelper.hash64(input.doubleValue(),
seed.value);
+ }
+ }
+
+ @FunctionTemplate(name = "hash64AsDouble", scope = FunctionScope.SIMPLE,
nulls = FunctionTemplate.NullHandling.INTERNAL)
+ public static class NullableVarDecimalHash implements DrillSimpleFunc {
+ @Param NullableVarDecimalHolder in;
+ @Param BigIntHolder seed;
+ @Output BigIntHolder out;
+
+ public void setup() {
+ }
+
+ public void eval() {
+ if (in.isSet == 0) {
+ out.value = seed.value;
+ } else {
+ java.math.BigDecimal input =
org.apache.drill.exec.util.DecimalUtility.getBigDecimalFromDrillBuf(in.buffer,
+ in.start, in.end - in.start, in.scale);
+ out.value =
org.apache.drill.exec.expr.fn.impl.HashHelper.hash64(input.doubleValue(),
seed.value);
+ }
+ }
+ }
--- End diff --
Thanks for pointing this, removed functions that use old decimals.
> Decimal data type enhancements
> ------------------------------
>
> Key: DRILL-6094
> URL: https://issues.apache.org/jira/browse/DRILL-6094
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.12.0
> Reporter: Volodymyr Vysotskyi
> Assignee: Volodymyr Vysotskyi
> Priority: Major
> Labels: doc-impacting
> Fix For: 1.14.0
>
>
> Currently, Decimal types are disabled by default since existing Decimal
> implementation has a lot of flaws and performance problems. The goal of thisĀ
> Jira to describe majority of them and possible ways of improving existing
> implementation to be able to enable Decimal data types by default.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)