[ 
https://issues.apache.org/jira/browse/TRAFODION-3115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16519863#comment-16519863
 ] 

ASF GitHub Bot commented on TRAFODION-3115:
-------------------------------------------

Github user zellerh commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1616#discussion_r197273178
  
    --- Diff: core/sql/common/DatetimeType.h ---
    @@ -69,7 +69,10 @@ class DatetimeType : public DatetimeIntervalCommonType
     public:
     
       enum { DEFAULT_FRACTION_PRECISION = 0 };      // See ANSI 6.1 SR 25: zero
    -  enum { MAX_FRACTION_PRECISION = 6 };  // See ANSI 6.1 SR 26: max is at 
least 6
    +  enum { MAX_FRACTION_PRECISION_MSEC = 6 }; // max microseconds fract 
precision
    --- End diff --
    
    I would read MSEC as milliseconds, USEC as microseconds.


> Support nanoseconds(9) precision for Timestamp columns
> ------------------------------------------------------
>
>                 Key: TRAFODION-3115
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3115
>             Project: Apache Trafodion
>          Issue Type: Improvement
>            Reporter: Anoop Sharma
>            Assignee: Anoop Sharma
>            Priority: Minor
>
> Traf supports max fractional precision of 6 (microseconds) for Timestamp 
> columns. 
> It prevents values with fractional precision greater than 6 digits to be 
> inserted into these columns.
> This becomes a bigger issue when dealing with Hive tables that have existing 
> data with nanoseconds(9) precision. Selecting that data returns an error and 
> causes queries to fail. Using a CAST to truncate data to timestamp(6) doesn't 
> work either.
> Example:
>    From Traf:  create table hive.hive.ts (a timestamp);
>    From Hive:  insert into ts values ('2018-01-01 10:10:10.123456789');
>    From Traf:  selecting data from table 'ts' returns error:
>             >>select * from hive.hive.ts;
>               *** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not 
> valid and                         cannot be converted. Source data: 
> 2018-01-01 10:10:10.123456789
>             --- 0 row(s) selected.
>            
>              >>select cast(a as timestamp(6)) from hive.hive.ts;
>               *** ERROR[8415] The provided DATE, TIME, or TIMESTAMP is not 
> valid and                         cannot be converted. Source data: 
> 2018-01-01 10:10:10.123456789
>             --- 0 row(s) selected.
>  
>  This Jira is filed to add support for max precision of 9 for Timestamp 
> columns. of Traf and Hive tables.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to