Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-12251 Rework the Table API & SQL type system
  3. FLINK-19913

The precision in document and code of `INTERVAL DAY(p1) TO SECOND(p2)` are inconsistent

    XMLWordPrintableJSON

Details

    Description

      The precision in document and code of `INTERVAL DAY(p1) TO SECOND(p2)` are inconsistent. In doc:

      INTERVAL DAY(p1) TO SECOND(p2)
      
      The type can be declared using the above combinations where p1 is the number of digits of days (day precision) and p2 is the number of digits of fractional seconds (fractional precision). p1 must have a value between 1 and 6 (both inclusive). p2 must have a value between 0 and 9 (both inclusive). If no p1 is specified, it is equal to 2 by default. If no p2 is specified, it is equal to 6 by default. 
      
      

      In code:

       case typeName if DAY_INTERVAL_TYPES.contains(typeName) =>
              if (relDataType.getPrecision > 3) {
                throw new TableException(
                  s"DAY_INTERVAL_TYPES precision is not supported: ${relDataType.getPrecision}")
              }
      

      BTW: We can also refer to Oracle's definition of support for INTERVAL:
      https://oracle-base.com/articles/misc/oracle-dates-timestamps-and-intervals#interval

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sunjincheng121 sunjincheng
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: