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

[C++] Cast fixed size list to compatible fixed size list type (other values type, other field name)

    XMLWordPrintableJSON

Details

    Description

      Casting a FixedSizeListArray to a compatible type but only a different field name isn't implemented:

      >>> my_type = pa.list_(pa.field("element", pa.int64()), 2)
      >>> arr = pa.FixedSizeListArray.from_arrays(pa.array([1, 2, 3, 4, 5, 6]), 2)
      >>> arr.type
      FixedSizeListType(fixed_size_list<item: int64>[2])
      >>> my_type
      FixedSizeListType(fixed_size_list<element: int64>[2])
      
      >>> arr.cast(my_type)
      ...
      ArrowNotImplementedError: Unsupported cast from fixed_size_list<item: int64>[2] to fixed_size_list using function cast_fixed_size_list
      

      While the similar operation with a variable sized list actually works:

      >>> my_type = pa.list_(pa.field("element", pa.int64()))
      >>> arr = pa.array([[1, 2], [3, 4]], pa.list_(pa.int64()))
      >>> arr.type
      ListType(list<item: int64>)
      >>> arr.cast(my_type).type
      ListType(list<element: int64>)
      

      Attachments

        Issue Links

          Activity

            People

              kshitij12345 Kshiteej K
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 4h 40m
                  4h 40m