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

[R] as_arrow_array() ignores type argument for StructArrays

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 10.0.0
    • R

    Description

      While `Arrow$create()` respects the types provided by the `type` argument, they are ignored when using `as_arrow_array()`. Compare the output below:

       

      library(arrow, warn.conflicts = FALSE)
      
      dataset <- data.frame(
      a = 1,
      b = 2,
      c = 3
      )
      
      types <- struct(a = int16(), b = int32(), c = int64())
      
      as_arrow_array(
      dataset, 
      type = types
      )$type
      #> StructType
      #> struct<a: double, b: double, c: double>
      
      Array$create(
      dataset, 
      type = types
      )$type
      #> StructType
      #> struct<a: int16, b: int32, c: int64>

      I have identified the bug and will submit a PR.

      Attachments

        Issue Links

          Activity

            People

              fmic François Michonneau
              fmic François Michonneau
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 1.5h
                  1.5h