[
https://issues.apache.org/jira/browse/ORC-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16461789#comment-16461789
]
ASF GitHub Bot commented on ORC-345:
------------------------------------
Github user prasanthj commented on a diff in the pull request:
https://github.com/apache/orc/pull/252#discussion_r185676846
--- Diff:
java/core/src/test/org/apache/orc/impl/TestColumnStatisticsImpl.java ---
@@ -85,4 +86,53 @@ public void testOldTimestamps() throws IOException {
assertEquals("2037-01-01 00:00:00.0", stats.getMaximum().toString());
TimeZone.setDefault(original);
}
+
+ @Test
+ public void testDecimal64Overflow() throws IOException {
+ TypeDescription schema = TypeDescription.fromString("decimal(18,6)");
+ OrcProto.ColumnStatistics.Builder pb =
+ OrcProto.ColumnStatistics.newBuilder();
+ OrcProto.DecimalStatistics.Builder decimalBuilder =
+ OrcProto.DecimalStatistics.newBuilder();
+ decimalBuilder.setMaximum("1000.0");
+ decimalBuilder.setMinimum("1.010");
+ decimalBuilder.setSum("123456789.123456");
+ pb.setDecimalStatistics(decimalBuilder);
+ pb.setHasNull(false);
+ pb.setNumberOfValues(3);
+
+ // the base case doesn't overflow
+ DecimalColumnStatistics stats1 = (DecimalColumnStatistics)
--- End diff --
Can you also add a test for merge with opposite signs (adding negative and
positive so that overflow if condition in merge() gets covered) and also one
that overflows?
> Create a Decimal64StatisticsImpl
> --------------------------------
>
> Key: ORC-345
> URL: https://issues.apache.org/jira/browse/ORC-345
> Project: ORC
> Issue Type: Improvement
> Reporter: Owen O'Malley
> Assignee: Owen O'Malley
> Priority: Major
>
> We should create a fast path for handling decimal statistics where precision
> <= 18 where the values can be handled as longs.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)