Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-12317

[Rust] JSON writer does not support time, date or interval types

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0
    • Rust

    Description

      While working on https://issues.apache.org/jira/browse/ARROW-12267 , adding support for writing Timestamp types, I noticed we were also lacking support for other time types. Specifically, if you try to write an array with any of the following types as JSON it will panic:

      An example of adding support for timestamps is on https://github.com/apache/arrow/pull/9968

      ```
      pub type Date32Array = PrimitiveArray<Date32Type>;
      pub type Date64Array = PrimitiveArray<Date64Type>;
      pub type Time32SecondArray = PrimitiveArray<Time32SecondType>;
      pub type Time32MillisecondArray = PrimitiveArray<Time32MillisecondType>;
      pub type Time64MicrosecondArray = PrimitiveArray<Time64MicrosecondType>;
      pub type Time64NanosecondArray = PrimitiveArray<Time64NanosecondType>;
      pub type IntervalYearMonthArray = PrimitiveArray<IntervalYearMonthType>;
      pub type IntervalDayTimeArray = PrimitiveArray<IntervalDayTimeType>;
      pub type DurationSecondArray = PrimitiveArray<DurationSecondType>;
      pub type DurationMillisecondArray = PrimitiveArray<DurationMillisecondType>;
      pub type DurationMicrosecondArray = PrimitiveArray<DurationMicrosecondType>;
      pub type DurationNanosecondArray = PrimitiveArray<DurationNanosecondType>;
      ```

      Attachments

        Issue Links

          Activity

            People

              houqp QP Hou
              alamb Andrew Lamb
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m