Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0, 0.8.1
    • Component/s: None
    • Labels:
      None

      Description

      In order to provide the following features, INTERVAL Type is required.

      babokim# select timestamp '2001-09-28 01:00' + interval '23 hours';
            ?column?
      ---------------------
       2001-09-29 00:00:00
      (1 row)
      
      babokim=# select date '2001-10-01' - date '2001-09-28';
       ?column?
      ----------
              3
      (1 row)
      
      1. TAJO-761_2.patch
        386 kB
        Hyoungjun Kim
      2. TAJO-761_3.patch
        94 kB
        Hyoungjun Kim
      3. TAJO-761_4.patch
        72 kB
        Hyoungjun Kim
      4. TAJO-761_5.patch
        72 kB
        Hyoungjun Kim
      5. TAJO-761_6.patch
        71 kB
        Hyunsik Choi
      6. TAJO-761.patch
        73 kB
        Hyoungjun Kim

        Activity

        Hide
        hyunsik Hyunsik Choi added a comment -

        As the same reason I mentioned in TAJO-212, I close this issue, and I move your problem into TAJO-1003.

        Thank you for your report.

        Show
        hyunsik Hyunsik Choi added a comment - As the same reason I mentioned in TAJO-212 , I close this issue, and I move your problem into TAJO-1003 . Thank you for your report.
        Hide
        Christian Schwabe Christian Schwabe added a comment -

        See the last two comments.

        Show
        Christian Schwabe Christian Schwabe added a comment - See the last two comments.
        Hide
        Christian Schwabe Christian Schwabe added a comment -

        >> SELECT timestamp '2001-09-28 01:00' INTERVAL + '1 days' results in '2001-09-29 00:00:00' // There is one hour missing.
        I think all functions should be checked again on your correctness.

        Show
        Christian Schwabe Christian Schwabe added a comment - >> SELECT timestamp '2001-09-28 01:00' INTERVAL + '1 days' results in '2001-09-29 00:00:00' // There is one hour missing. I think all functions should be checked again on your correctness.
        Hide
        Christian Schwabe Christian Schwabe added a comment -

        In my case by tipping >> SELECT timestamp '2001-09-28 01:00' + INTERVAL '23 hours'; I get the following result: '2001-09-28 23:00:00'. There is missing one hour. Can anyone agree with that?
        I use the version 0.9.0-SNAPSHOT.

        Show
        Christian Schwabe Christian Schwabe added a comment - In my case by tipping >> SELECT timestamp '2001-09-28 01:00' + INTERVAL '23 hours'; I get the following result: '2001-09-28 23:00:00'. There is missing one hour. Can anyone agree with that? I use the version 0.9.0-SNAPSHOT.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-master-build #200 (See https://builds.apache.org/job/Tajo-master-build/200/)
        TAJO-761: Implements INTERVAL type. (Hyoungjun Kim via hyunsik) (hyunsik: rev 5bbb7e822ecde5b783ed1d6210b0e9fe9262d054)

        • tajo-algebra/src/main/java/org/apache/tajo/algebra/OpType.java
        • tajo-common/src/main/java/org/apache/tajo/datum/TimestampDatum.java
        • tajo-core/src/main/java/org/apache/tajo/engine/function/datetime/ToDate.java
        • tajo-core/src/test/java/org/apache/tajo/engine/eval/TestIntervalType.java
        • tajo-common/src/main/java/org/apache/tajo/datum/Float8Datum.java
        • tajo-common/src/main/java/org/apache/tajo/datum/Int8Datum.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprsVerifier.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java
        • tajo-storage/src/main/java/org/apache/tajo/storage/RowStoreUtil.java
        • tajo-common/src/main/java/org/apache/tajo/util/TimeStampUtil.java
        • tajo-common/src/main/java/org/apache/tajo/datum/Int2Datum.java
        • tajo-algebra/src/main/java/org/apache/tajo/algebra/IntervalLiteral.java
        • tajo-core/src/test/java/org/apache/tajo/engine/function/TestDateTimeFunctions.java
        • tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java
        • tajo-common/src/main/java/org/apache/tajo/json/DatumAdapter.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/BaseAlgebraVisitor.java
        • CHANGES
        • tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4
        • tajo-common/src/test/java/org/apache/tajo/datum/TestIntervalDatum.java
        • tajo-core/src/main/java/org/apache/tajo/engine/eval/BinaryEval.java
        • tajo-common/src/main/java/org/apache/tajo/datum/DatumFactory.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/AlgebraVisitor.java
        • tajo-common/src/main/java/org/apache/tajo/datum/DateDatum.java
        • tajo-common/src/main/java/org/apache/tajo/datum/Int4Datum.java
        • tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLLexer.g4
        • tajo-common/src/main/java/org/apache/tajo/datum/Float4Datum.java
        • tajo-common/src/main/java/org/apache/tajo/datum/TimeDatum.java
        • tajo-common/src/test/java/org/apache/tajo/datum/TestTimestampDatum.java
        • tajo-storage/src/main/java/org/apache/tajo/storage/TextSerializerDeserializer.java
        • tajo-common/src/main/java/org/apache/tajo/datum/IntervalDatum.java
        • tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprAnnotator.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-master-build #200 (See https://builds.apache.org/job/Tajo-master-build/200/ ) TAJO-761 : Implements INTERVAL type. (Hyoungjun Kim via hyunsik) (hyunsik: rev 5bbb7e822ecde5b783ed1d6210b0e9fe9262d054) tajo-algebra/src/main/java/org/apache/tajo/algebra/OpType.java tajo-common/src/main/java/org/apache/tajo/datum/TimestampDatum.java tajo-core/src/main/java/org/apache/tajo/engine/function/datetime/ToDate.java tajo-core/src/test/java/org/apache/tajo/engine/eval/TestIntervalType.java tajo-common/src/main/java/org/apache/tajo/datum/Float8Datum.java tajo-common/src/main/java/org/apache/tajo/datum/Int8Datum.java tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprsVerifier.java tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprNormalizer.java tajo-storage/src/main/java/org/apache/tajo/storage/RowStoreUtil.java tajo-common/src/main/java/org/apache/tajo/util/TimeStampUtil.java tajo-common/src/main/java/org/apache/tajo/datum/Int2Datum.java tajo-algebra/src/main/java/org/apache/tajo/algebra/IntervalLiteral.java tajo-core/src/test/java/org/apache/tajo/engine/function/TestDateTimeFunctions.java tajo-core/src/main/java/org/apache/tajo/engine/parser/SQLAnalyzer.java tajo-common/src/main/java/org/apache/tajo/json/DatumAdapter.java tajo-core/src/main/java/org/apache/tajo/engine/planner/BaseAlgebraVisitor.java CHANGES tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLParser.g4 tajo-common/src/test/java/org/apache/tajo/datum/TestIntervalDatum.java tajo-core/src/main/java/org/apache/tajo/engine/eval/BinaryEval.java tajo-common/src/main/java/org/apache/tajo/datum/DatumFactory.java tajo-core/src/main/java/org/apache/tajo/engine/planner/AlgebraVisitor.java tajo-common/src/main/java/org/apache/tajo/datum/DateDatum.java tajo-common/src/main/java/org/apache/tajo/datum/Int4Datum.java tajo-core/src/main/antlr4/org/apache/tajo/engine/parser/SQLLexer.g4 tajo-common/src/main/java/org/apache/tajo/datum/Float4Datum.java tajo-common/src/main/java/org/apache/tajo/datum/TimeDatum.java tajo-common/src/test/java/org/apache/tajo/datum/TestTimestampDatum.java tajo-storage/src/main/java/org/apache/tajo/storage/TextSerializerDeserializer.java tajo-common/src/main/java/org/apache/tajo/datum/IntervalDatum.java tajo-core/src/main/java/org/apache/tajo/engine/planner/ExprAnnotator.java
        Hide
        hyunsik Hyunsik Choi added a comment - - edited

        Since this patch can be applied to 0.8.1 branch without any additional change, I committed the patch to master and 0.8.1. Thank you for your nice contribution.

        Show
        hyunsik Hyunsik Choi added a comment - - edited Since this patch can be applied to 0.8.1 branch without any additional change, I committed the patch to master and 0.8.1. Thank you for your nice contribution.
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12641657/TAJO-761_6.patch
        against master revision 8c92a9d.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 4 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        -1 findbugs. The patch appears to introduce 194 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in tajo-algebra tajo-common tajo-core tajo-storage.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/385//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/385//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/385//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core.html
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/385//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12641657/TAJO-761_6.patch against master revision 8c92a9d. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. -1 findbugs. The patch appears to introduce 194 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-algebra tajo-common tajo-core tajo-storage. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/385//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/385//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/385//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core.html Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/385//console This message is automatically generated.
        Hide
        hyunsik Hyunsik Choi added a comment -

        +1

        It's awesome work. Even though the patch includes many changes, there are few trivial comments. It also includes enough unit tests. It looks almost perfect to me.

        Since trivial change are required, I submitted the updated patch that reflects them.

        In detail, the changes of the last patch:

        • removes commented out lines
        • renames IntervalDatum::interval to milliseconds because the name 'interval' seems duplicated to the class name.
        • removes printStackTrace in legal exception handling
        Show
        hyunsik Hyunsik Choi added a comment - +1 It's awesome work. Even though the patch includes many changes, there are few trivial comments. It also includes enough unit tests. It looks almost perfect to me. Since trivial change are required, I submitted the updated patch that reflects them. In detail, the changes of the last patch: removes commented out lines renames IntervalDatum::interval to milliseconds because the name 'interval' seems duplicated to the class name. removes printStackTrace in legal exception handling
        Hide
        hyunsik Hyunsik Choi added a comment -

        I changed its parent to TAJO-52. It would be more proper place rather than the issue of time-related functions.

        Show
        hyunsik Hyunsik Choi added a comment - I changed its parent to TAJO-52 . It would be more proper place rather than the issue of time-related functions.
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12641437/TAJO-761_5.patch
        against master revision bc1a323.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 4 new or modified test files.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The applied patch does not increase the total number of javadoc warnings.

        +1 checkstyle. The patch generated 0 code style errors.

        -1 findbugs. The patch appears to introduce 194 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in tajo-algebra tajo-common tajo-core tajo-storage.

        Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/381//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/381//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/381//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core.html
        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/381//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12641437/TAJO-761_5.patch against master revision bc1a323. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The applied patch does not increase the total number of javadoc warnings. +1 checkstyle. The patch generated 0 code style errors. -1 findbugs. The patch appears to introduce 194 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in tajo-algebra tajo-common tajo-core tajo-storage. Test results: https://builds.apache.org/job/PreCommit-TAJO-Build/381//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/381//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-TAJO-Build/381//artifact/incubator-tajo/patchprocess/newPatchFindbugsWarningstajo-core.html Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/381//console This message is automatically generated.
        Hide
        hjkim Hyoungjun Kim added a comment -

        Remove Long.compare()

        Show
        hjkim Hyoungjun Kim added a comment - Remove Long.compare()
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12641418/TAJO-761_4.patch
        against master revision bc1a323.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 4 new or modified test files.

        -1 javac. The patch appears to cause the build to fail.

        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/379//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12641418/TAJO-761_4.patch against master revision bc1a323. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified test files. -1 javac. The patch appears to cause the build to fail. Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/379//console This message is automatically generated.
        Hide
        hjkim Hyoungjun Kim added a comment -

        Change java.util.Objects(available in JDK1.7) to guava's Objects

        Show
        hjkim Hyoungjun Kim added a comment - Change java.util.Objects(available in JDK1.7) to guava's Objects
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12641408/TAJO-761_3.patch
        against master revision fe81035.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 4 new or modified test files.

        -1 javac. The patch appears to cause the build to fail.

        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/378//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12641408/TAJO-761_3.patch against master revision fe81035. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified test files. -1 javac. The patch appears to cause the build to fail. Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/378//console This message is automatically generated.
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12641397/TAJO-761_2.patch
        against master revision 89e8fa3.

        -1 patch. The patch command could not apply the patch.

        -1 @author. The patch appears to contain 2 @author tags which the Tajo community has agreed to not allow in code contributions.

        +1 tests included. The patch appears to include 46 new or modified test files.

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/376//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12641397/TAJO-761_2.patch against master revision 89e8fa3. -1 patch. The patch command could not apply the patch. -1 @author. The patch appears to contain 2 @author tags which the Tajo community has agreed to not allow in code contributions. +1 tests included. The patch appears to include 46 new or modified test files. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/376//console This message is automatically generated.
        Hide
        hjkim Hyoungjun Kim added a comment -

        Rebased

        Show
        hjkim Hyoungjun Kim added a comment - Rebased
        Hide
        tajoqa Tajo QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12640848/TAJO-761.patch
        against master revision cbe1d6e.

        -1 patch. The patch command could not apply the patch.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 4 new or modified test files.

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/368//console

        This message is automatically generated.

        Show
        tajoqa Tajo QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12640848/TAJO-761.patch against master revision cbe1d6e. -1 patch. The patch command could not apply the patch. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 4 new or modified test files. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-TAJO-Build/368//console This message is automatically generated.
        Hide
        hjkim Hyoungjun Kim added a comment -

        I attached first patch.
        We can use next query

        default> select date '2001-09-28' + 7;
        result: 1 rows (5 B)
        ?plus
        -------------------------------
        2001-10-05
        
        default> select date '2001-09-28' + interval '1 hour';
        result: 1 rows (9 B)
        ?plus
        -------------------------------
        2001-09-28 01:00:00
        
        default> select date '2001-09-28' + time '03:00';
        result: 1 rows (9 B)
        ?plus
        -------------------------------
        2001-09-28 03:00:00
        
        default> select interval '1 day' + interval '1 hour';
        result: 1 rows (19 B)
        ?plus
        -------------------------------
        1 day 01:00:00
        
        default> select timestamp '2001-09-28 01:00' + interval '23 hours';
        result: 1 rows (9 B)
        ?plus
        -------------------------------
        2001-09-29 00:00:00
        
        default> select time '01:00' + interval '3 hours';
        result: 1 rows (9 B)
        ?plus
        -------------------------------
        04:00:00
        
        default> select date '2001-10-01' - date '2001-09-28';
        result: 1 rows (5 B)
        ?minus
        -------------------------------
        3
        
        default> select date '2001-10-01' - 7;
        result: 1 rows (5 B)
        ?minus
        -------------------------------
        2001-09-24
        
        default> select date '2001-09-28' - interval '1 hour';
        result: 1 rows (9 B)
        ?minus
        -------------------------------
        2001-09-27 23:00:00
        
        default> select time '05:00' - time '03:00';
        result: 1 rows (13 B)
        ?minus
        -------------------------------
        02:00:00
        
        default> select time '05:00' - interval '2 hours';
        result: 1 rows (9 B)
        ?minus
        -------------------------------
        03:00:00
        
        default> select timestamp '2001-09-28 23:00' - interval '23 hours';
        result: 1 rows (9 B)
        ?minus
        -------------------------------
        2001-09-28 00:00:00
        
        default> select interval '1 day' - interval '1 hour';
        result: 1 rows (13 B)
        ?minus
        -------------------------------
        23:00:00
        
        default> select timestamp '2001-09-29 03:00' - timestamp '2001-09-27 12:00';
        result: 1 rows (19 B)
        ?minus
        -------------------------------
        1 day 15:00:00
        
        default> select 900 * interval '1 second';
        result: 1 rows (13 B)
        ?multiply
        -------------------------------
        00:15:00
        
        default> select 21 * interval '1 day';
        result: 1 rows (12 B)
        ?multiply
        -------------------------------
        21 days
        
        default> select 3.5 * interval '1 hour';
        result: 1 rows (13 B)
        ?multiply
        -------------------------------
        03:30:00
        
        default> select interval '1 hour' / 1.5;
        result: 1 rows (13 B)
        ?divide
        -------------------------------
        00:40:00
        

        And I added TO_DATE function in this patch in order to test INTERVAL_TYPE in the real cluster.
        TO_DATE function converts a format string to a DATE type value. Currently, this function only supports Java date format string.

        Show
        hjkim Hyoungjun Kim added a comment - I attached first patch. We can use next query default> select date '2001-09-28' + 7; result: 1 rows (5 B) ?plus ------------------------------- 2001-10-05 default> select date '2001-09-28' + interval '1 hour'; result: 1 rows (9 B) ?plus ------------------------------- 2001-09-28 01:00:00 default> select date '2001-09-28' + time '03:00'; result: 1 rows (9 B) ?plus ------------------------------- 2001-09-28 03:00:00 default> select interval '1 day' + interval '1 hour'; result: 1 rows (19 B) ?plus ------------------------------- 1 day 01:00:00 default> select timestamp '2001-09-28 01:00' + interval '23 hours'; result: 1 rows (9 B) ?plus ------------------------------- 2001-09-29 00:00:00 default> select time '01:00' + interval '3 hours'; result: 1 rows (9 B) ?plus ------------------------------- 04:00:00 default> select date '2001-10-01' - date '2001-09-28'; result: 1 rows (5 B) ?minus ------------------------------- 3 default> select date '2001-10-01' - 7; result: 1 rows (5 B) ?minus ------------------------------- 2001-09-24 default> select date '2001-09-28' - interval '1 hour'; result: 1 rows (9 B) ?minus ------------------------------- 2001-09-27 23:00:00 default> select time '05:00' - time '03:00'; result: 1 rows (13 B) ?minus ------------------------------- 02:00:00 default> select time '05:00' - interval '2 hours'; result: 1 rows (9 B) ?minus ------------------------------- 03:00:00 default> select timestamp '2001-09-28 23:00' - interval '23 hours'; result: 1 rows (9 B) ?minus ------------------------------- 2001-09-28 00:00:00 default> select interval '1 day' - interval '1 hour'; result: 1 rows (13 B) ?minus ------------------------------- 23:00:00 default> select timestamp '2001-09-29 03:00' - timestamp '2001-09-27 12:00'; result: 1 rows (19 B) ?minus ------------------------------- 1 day 15:00:00 default> select 900 * interval '1 second'; result: 1 rows (13 B) ?multiply ------------------------------- 00:15:00 default> select 21 * interval '1 day'; result: 1 rows (12 B) ?multiply ------------------------------- 21 days default> select 3.5 * interval '1 hour'; result: 1 rows (13 B) ?multiply ------------------------------- 03:30:00 default> select interval '1 hour' / 1.5; result: 1 rows (13 B) ?divide ------------------------------- 00:40:00 And I added TO_DATE function in this patch in order to test INTERVAL_TYPE in the real cluster. TO_DATE function converts a format string to a DATE type value. Currently, this function only supports Java date format string.
        Hide
        hjkim Hyoungjun Kim added a comment - - edited

        Created a review request against branch master in reviewboard
        https://reviews.apache.org/r/20491/

        Show
        hjkim Hyoungjun Kim added a comment - - edited Created a review request against branch master in reviewboard https://reviews.apache.org/r/20491/

          People

          • Assignee:
            hjkim Hyoungjun Kim
            Reporter:
            hjkim Hyoungjun Kim
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development