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

"INTERVAL '1111111111' YEAR(10)" yields garbage result

    XMLWordPrintableJSON

Details

    Description

      Some interval literals yield garbage results.

      It seems to be those with YEAR and/or MONTH fields, with Drill's maximum leading-digit precision (10), and having a ten-digit value for that leading field (even when it's 10 digits that fit in int).

      0: jdbc:drill:zk=local> SELECT  INTERVAL '1111111111' YEAR(10) FROM INFORMATION_SCHEMA.CATALOGS;
      +-------------+
      |   EXPR$0    |
      +-------------+
      | P37369287Y  |
      +-------------+
      1 row selected (0.234 seconds)
      0: jdbc:drill:zk=local> 
      
      0: jdbc:drill:zk=local> SELECT  INTERVAL '1111111111' MONTH(10) FROM INFORMATION_SCHEMA.CATALOGS;
      +---------------+
      |    EXPR$0     |
      +---------------+
      | P92592592Y7M  |
      +---------------+
      1 row selected (0.171 seconds)
      0: jdbc:drill:zk=local> 
      
      0: jdbc:drill:zk=local> SELECT  INTERVAL '1111111111-06' YEAR(10) TO MONTH FROM INFORMATION_SCHEMA.CATALOGS;
      +---------------+
      |    EXPR$0     |
      +---------------+
      | P37369287Y6M  |
      +---------------+
      1 row selected (0.229 seconds)
      0: jdbc:drill:zk=local> 
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dsbos Daniel Barclay
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: