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

IntervalDay vector returns a non-normalized Period object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.10.0
    • None
    • None
    • None

    Description

      Set an IntervalDay column using a Period object of the form P3DT4H5M23S.

      Retrieve the data using getObject(), which returns a Period. However, the object is not normalized; it comes back as P3DT14723S.

      The problem is how we create the object:

          @Override
          public Period getObject(int index) {
            final int offsetIndex = index * VALUE_WIDTH;
            final int millis = data.getInt(offsetIndex + 4);
            final int  days   = data.getInt(offsetIndex);
            final Period p = new Period();
            return p.plusDays(days).plusMillis(millis);
          }
      

      The workaround is to call normalizedStandard() to the returned value. Instead, this method should be called before returning the result.

      Attachments

        Activity

          People

            Unassigned Unassigned
            paul-rogers Paul Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: