[ https://issues.apache.org/jira/browse/HIVE-23927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17176135#comment-17176135 ]
László Bodor commented on HIVE-23927: ------------------------------------- unfortunately, I cannot recall anything from ORC-554 which is related to this, in ORC-554 we handled an overflow case, where a float is not precise enough to represent a timestamp, and messes up the values in TimestampColumnVector ([fix is here|https://github.com/apache/orc/commit/7de945b080c5ca83b84397db105f70082a2107f4#diff-9090b54d59f8163ec2be71169d4813c8R1412-R1426]) this one is indeed not related to ORC/schemaevolution, but the reported problem is present on master, [as my repro shows|https://github.com/abstractdog/hive/commit/54ec318203#diff-219ede90fa98943fb8e1518350ff074dR36] > Cast to Timestamp generates different output for Integer & Float values > ------------------------------------------------------------------------ > > Key: HIVE-23927 > URL: https://issues.apache.org/jira/browse/HIVE-23927 > Project: Hive > Issue Type: Bug > Reporter: Renukaprasad C > Priority: Major > > Double consider the input value as SECOND and converts into Millis internally. > Whereas, Integer value will be considered as Millis and produce different > output. > org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorUtils.getTimestamp(Object, > PrimitiveObjectInspector, boolean) - Handles Integral & Decimal values > differently. This cause the issue. > 0: jdbc:hive2://localhost:10000> select cast(1.204135216E9 as timestamp) > Double2TimeStamp, cast(1204135216 as timestamp) Int2TimeStamp from abc > tablesample(1 rows); > OK > INFO : Compiling > command(queryId=renu_20200724140642_70132390-ee12-4214-a2ca-a7e10556fc14): > select cast(1.204135216E9 as timestamp) Double2TimeStamp, cast(1204135216 as > timestamp) Int2TimeStamp from abc tablesample(1 rows) > INFO : Concurrency mode is disabled, not creating a lock manager > INFO : Semantic Analysis Completed (retrial = false) > INFO : Returning Hive schema: > Schema(fieldSchemas:[FieldSchema(name:double2timestamp, type:timestamp, > comment:null), FieldSchema(name:int2timestamp, type:timestamp, > comment:null)], properties:null) > INFO : Completed compiling > command(queryId=renu_20200724140642_70132390-ee12-4214-a2ca-a7e10556fc14); > Time taken: 0.175 seconds > INFO : Concurrency mode is disabled, not creating a lock manager > INFO : Executing > command(queryId=renu_20200724140642_70132390-ee12-4214-a2ca-a7e10556fc14): > select cast(1.204135216E9 as timestamp) Double2TimeStamp, cast(1204135216 as > timestamp) Int2TimeStamp from abc tablesample(1 rows) > INFO : Completed executing > command(queryId=renu_20200724140642_70132390-ee12-4214-a2ca-a7e10556fc14); > Time taken: 0.001 seconds > INFO : OK > INFO : Concurrency mode is disabled, not creating a lock manager > +------------------------+--------------------------+ > | double2timestamp | int2timestamp | > +------------------------+--------------------------+ > | 2008-02-27 18:00:16.0 | 1970-01-14 22:28:55.216 | > +------------------------+--------------------------+ -- This message was sent by Atlassian Jira (v8.3.4#803005)