Github user vvysotskyi commented on a diff in the pull request:
https://github.com/apache/drill/pull/570#discussion_r160473858
--- Diff:
exec/java-exec/src/main/codegen/templates/Decimal/DecimalAggrTypeFunctions2.java
---
@@ -108,9 +108,12 @@ public void output() {
out.buffer = buffer;
out.start = 0;
out.scale = outputScale.value;
- out.precision = 38;
java.math.BigDecimal average =
((java.math.BigDecimal)(value.obj)).divide(java.math.BigDecimal.valueOf(count.value,
0), out.scale, java.math.BigDecimal.ROUND_HALF_UP);
+<#if type.inputType.contains("VarDecimal")>
--- End diff --
It would be better to swap if and else and negate if condition for better
readability.
---