Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-417

TestSQLExpression.testCastFromTable causes unit test failure

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: Expression
    • Labels:
      None

      Description

      testSimpleEval("select '1980-04-01 01:50:01'::timestamp::bigint;", new String [] {"323369401000"});
          testSimpleEval("select ('1980-04-01 01:50:01'::timestamp)::bigint;", new String [] {"323369401000"});
      

      The above unit tests can cause failure due to the precision difference between bigint value and the value casted from timestamp string. This patch eliminates the difference by using only timestamp strings.

      testSimpleEval("select '1980-04-01 01:50:01'::timestamp::bigint::timestamp", new String [] {"1980-04-01 01:50:01"});
          testSimpleEval("select cast (('1980-04-01 01:50:01'::timestamp)::bigint as timestamp)",
              new String [] {"1980-04-01 01:50:01"});
      
      1. TAJO-417.patch
        1 kB
        Hyunsik Choi

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Tajo-trunk-postcommit #620 (See https://builds.apache.org/job/Tajo-trunk-postcommit/620/)
        TAJO-417: TestSQLExpression.testCastFromTable causes unit test failure. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=b4a71dc74171416f4274e524d07a685b54d9067d)

        • tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/eval/TestSQLExpression.java
        • CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Tajo-trunk-postcommit #620 (See https://builds.apache.org/job/Tajo-trunk-postcommit/620/ ) TAJO-417 : TestSQLExpression.testCastFromTable causes unit test failure. (hyunsik) (hyunsik: https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=b4a71dc74171416f4274e524d07a685b54d9067d ) tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/engine/eval/TestSQLExpression.java CHANGES.txt
        Hide
        hyunsik Hyunsik Choi added a comment -

        committed. thanks!

        Show
        hyunsik Hyunsik Choi added a comment - committed. thanks!
        Hide
        jihoonson Jihoon Son added a comment -

        +1

        Show
        jihoonson Jihoon Son added a comment - +1
        Show
        hyunsik Hyunsik Choi added a comment - This problem causes the current jenkins test failures. https://builds.apache.org/job/Tajo-trunk-postcommit/617/testReport/org.apache.tajo.engine.eval/TestSQLExpression/testCastFromTable/

          People

          • Assignee:
            hyunsik Hyunsik Choi
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development