Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4021

Cannot subract or add between two timestamps

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Execution - Data Types

    Description

      The following subtraction between 2 now() function works:
      select now() - now()from voter_hive limit 1;
      ---------

      EXPR$0

      ---------

      PT0S

      ---------

      However, the following queries fail:
      select now() - create_time from voter_hive where voter_id=1;
      Error: VALIDATION ERROR: From line 1, column 8 to line 1, column 26: Cannot apply '-' to arguments of type '<ANY> - <TIMESTAMP(0)>'. Supported form(s): '<NUMERIC> - <NUMERIC>'
      '<DATETIME_INTERVAL> - <DATETIME_INTERVAL>'
      '<DATETIME> - <DATETIME_INTERVAL>'

      select create_time - cast('1997-02-12 15:18:31.072' as timestamp) from voter_hive where voter_id=1;
      Error: VALIDATION ERROR: From line 1, column 8 to line 1, column 65: Cannot apply '-' to arguments of type '<TIMESTAMP(0)> - <TIMESTAMP(0)>'. Supported form(s): '<NUMERIC> - <NUMERIC>'
      '<DATETIME_INTERVAL> - <DATETIME_INTERVAL>'
      '<DATETIME> - <DATETIME_INTERVAL>'

      Attachments

        1. Screen Shot 2015-11-03 at 3.44.30 PM.png
          53 kB
          Victoria Markman
        2. Screen Shot 2015-11-04 at 7.35.07 AM.png
          89 kB
          Julian Hyde
        3. Screen Shot 2015-11-04 at 8.12.34 AM.png
          56 kB
          Victoria Markman
        4. photo-2.JPG
          794 kB
          Victoria Markman

        Activity

          People

            Unassigned Unassigned
            knguyen Krystal
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: