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

[Rust] Reading Date32 and Date64 errors - they are incorrectly converted to RecordBatch

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Component/s: Rust

      Description

      Steps to reproduce:

      1. Create a file `a.parquet` using the following code:

      import pyarrow.parquet
      import numpy
      
      
      def _data_datetime(f):
          data = numpy.array([
              numpy.datetime64('2018-08-18 23:25'),
              numpy.datetime64('2019-08-18 23:25'),
              numpy.datetime64("NaT")
          ])
          data = numpy.array(data, dtype=f'datetime64[{f}]')
          return data
      
      def _write_parquet(path, data):
          table = pyarrow.Table.from_arrays([pyarrow.array(data)], names=['a'])
          pyarrow.parquet.write_table(table, path)
          return path
      
      
      _write_parquet('a.parquet', _data_datetime('D'))
      

      2. Write a small example to read it to RecordBatches

      3. observe the error ArrowError(ParquetError("InvalidArgumentError(\"column types must match schema types, expected Date32(Day) but found UInt32 at column index 0\")"))

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jorgecarleitao Jorge
                Reporter:
                jorgecarleitao Jorge
              • 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 - 3.5h
                  3.5h