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

Need to support conversion from TIMESTAMP type to TIME type

    XMLWordPrintableJSON

Details

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

    Description

      According to ISO/IEC-2 9075 standard, TIMESTAMP type to TIME type conversion is allowed and supported.
      This does not seem to work on Drill 1.7.0

      0: jdbc:drill:schema=dfs.tmp> values(TIME '2050-2-3 10:11:12.1000');
      Error: PARSE ERROR: Illegal TIME literal '2050-2-3 10:11:12.1000': not in format 'HH:mm:ss'
      
      SQL Query values(TIME '2050-2-3 10:11:12.1000')
             ^
      
      
      [Error Id: 77168fe0-760f-4384-a7c6-682241675348 on centos-03.qa.lab:31010] (state=,code=0)
      0: jdbc:drill:schema=dfs.tmp> values(cast('2050-2-3 10:11:12.1000' as time));
      Error: SYSTEM ERROR: IllegalArgumentException: Invalid format: "2050-2-3 10:11:12.1000" is malformed at "50-2-3 10:11:12.1000"
      
      Fragment 0:0
      
      [Error Id: 5168dfe6-b5e5-4ce0-8570-02ea74da6367 on centos-03.qa.lab:31010] (state=,code=0)
      0: jdbc:drill:schema=dfs.tmp>
      

      The above two expressions are supported on Postgres 9.3

      postgres=# values(TIME '2050-2-3 10:11:12.1000');
        column1   
      ------------
       10:11:12.1
      (1 row)
      
      postgres=# values(cast('2050-2-3 10:11:12.1000' as time));
        column1   
      ------------
       10:11:12.1
      (1 row)
      
      postgres=# 
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            khfaraaz Khurram Faraaz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: