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

[C++] Deprecate PrimitiveArray::raw_values

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.8.0
    • Component/s: C++

      Description

      I ran into an odd issue where, even though I was casting to arrow::PrimitiveArray, it picked up the raw_values method from a subclass of PrimitiveArray (which includes a slice offset)

      (gdb) p reinterpret_cast<const int64_t*>(reinterpret_cast<const PrimitiveArray&>(arr).raw_values())[0]
      $9 = 25
      (gdb) p reinterpret_cast<const int64_t*>(reinterpret_cast<const PrimitiveArray&>(arr).raw_values_)[0]
      $10 = 10
      (gdb) p arr.offset()
      $11 = 15
      

      I think the raw_values method in PrimitiveArray should be deprecated and removed, since it is dangerous to use as it does not include a slice offset, if any

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                wesmckinn Wes McKinney
                Reporter:
                wesmckinn Wes McKinney
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: