You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Qiang.Kang (Jira)" <ji...@apache.org> on 2021/02/06 03:50:00 UTC
[jira] [Assigned] (HIVE-24748) The result of
TimestampWritableV2.toString() is wrong when year is larger than 9999.
[ https://issues.apache.org/jira/browse/HIVE-24748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Qiang.Kang reassigned HIVE-24748:
---------------------------------
Assignee: Qiang.Kang
> The result of TimestampWritableV2.toString() is wrong when year is larger than 9999.
> ------------------------------------------------------------------------------------
>
> Key: HIVE-24748
> URL: https://issues.apache.org/jira/browse/HIVE-24748
> Project: Hive
> Issue Type: Bug
> Components: Serializers/Deserializers
> Affects Versions: All Versions
> Environment: Master branch
> Reporter: Qiang.Kang
> Assignee: Qiang.Kang
> Priority: Critical
>
> Hi, I found that `TimestampWritableV2.toString()` can be wrong when year is larger than 9999. Here is what I get:
> - test code:
> ```
> @Test
> publicvoidtestTimestampWritableV2toString() \{ TimestampWritableV2timestampWritableV2 = newTimestampWritableV2( Timestamp.valueOf("10001-01-01 01:01:23")); assertEquals("+10001-01-01 01:01:23", timestampWritableV2.toString()); }
> ```
> - output:
> ```
> org.junit.ComparisonFailure:
> Expected :+10001-01-01 01:01:23
> Actual :+10001-01-01 01:01:2323
> ```
> The patch below removes some 'wrong' code in `TimestampWritableV2.toString()`, for the reason that the length of `org.apache.hadoop.hive.common.type.Timestamp#toString` can be larger than 19, even its nano-of-second is zero.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)