drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4782) TO_TIME function cannot separate time from date time string
Date Wed, 08 May 2019 07:56:00 GMT

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

ASF GitHub Bot commented on DRILL-4782:
---------------------------------------

ihuzenko commented on pull request #1784: DRILL-4782 / DRILL-7139: Fix cast and arithmetic
for DayInterval 
URL: https://github.com/apache/drill/pull/1784#discussion_r281950867
 
 

 ##########
 File path: exec/java-exec/src/main/codegen/templates/DateIntervalFunctionTemplates/IntervalIntervalArithmetic.java
 ##########
 @@ -90,6 +99,21 @@ public void eval() {
             <#elseif intervaltype == "IntervalDay">
             out.days = left.days - right.days;
             out.milliseconds = left.milliseconds - right.milliseconds;
+
+            // redistribute days stored in millis to days
+            int daysFromMillis = Math.abs(out.milliseconds) / org.apache.drill.exec.vector.DateUtilities.daysToStandardMillis;
 
 Review comment:
   ```suggestion
       int daysFromMillis = out.milliseconds / org.apache.drill.exec.vector.DateUtilities.daysToStandardMillis;
       if (daysFromMillis != 0) {
         out.milliseconds -= org.apache.drill.exec.vector.DateUtilities.daysToStandardMillis
* daysFromMillis;
         out.days -= Math.abs(daysFromMillis);
       }
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> TO_TIME function cannot separate time from date time string
> -----------------------------------------------------------
>
>                 Key: DRILL-4782
>                 URL: https://issues.apache.org/jira/browse/DRILL-4782
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components:  Server
>    Affects Versions: 1.6.0, 1.7.0
>         Environment: CentOS 7
>            Reporter: Matt Keranen
>            Assignee: Dmytriy Grinchenko
>            Priority: Minor
>             Fix For: 1.17.0
>
>
> TO_TIME('2016-03-03 00:00', ''yyyy-MM-dd HH:mm') returns "05:14:46.656" instead of the
expected "00:00:00"
> Adding and additional split does work as expected: TO_TIME(SPLIT('2016-03-03 00:00',
' ')[1], 'HH:mm')



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

Mime
View raw message