Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-11003 [C++][Dataset] Schema evolution in Dataset scanning
  3. ARROW-9147

[C++][Dataset] Support null -> other type promotion in Dataset scanning

    XMLWordPrintableJSON

Details

    Description

      With regarding schema evolution / normalization, we support inserting nulls for a missing column or changing nullability, or normalizing column order, but we do not yet seem to support promotion of null type to any other type.

      Small python example:

      In [11]: df = pd.DataFrame({"col": np.array([None, None, None, None], dtype='object')})
          ...: df.to_parquet("test_filter_schema.parquet", engine="pyarrow")
          ...:
          ...: import pyarrow.dataset as ds
          ...: dataset = ds.dataset("test_filter_schema.parquet", format="parquet", schema=pa.schema([("col", pa.int64())]))
          ...: dataset.to_table()
      ...
      ~/scipy/repos/arrow/python/pyarrow/_dataset.pyx in pyarrow._dataset.Dataset.to_table()
      ~/scipy/repos/arrow/python/pyarrow/_dataset.pyx in pyarrow._dataset.Scanner.to_table()
      ~/scipy/repos/arrow/python/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()
      ~/scipy/repos/arrow/python/pyarrow/error.pxi in pyarrow.lib.check_status()
      ArrowTypeError: fields had matching names but differing types. From: col: null To: col: int64
      

      Attachments

        Issue Links

          Activity

            People

              bkietz Ben Kietzman
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              8 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