Ebraam-Ashraf commented on PR #49443:
URL: https://github.com/apache/arrow/pull/49443#issuecomment-4005743540

   **Tests before fix** 
   ```
   [   RUN    ] TestIfElseBaseBinary/0.IfElseBaseBinarySliced
   [  FAILED  ] TestIfElseBaseBinary/0.IfElseBaseBinarySliced (20 ms)
   [  FAILED  ] TestIfElseBaseBinary/1.IfElseBaseBinarySliced (1 ms)
   [  FAILED  ] TestIfElseBaseBinary/2.IfElseBaseBinarySliced (1 ms)
   [  FAILED  ] TestIfElseBaseBinary/3.IfElseBaseBinarySliced (0 ms)
   [  PASSED  ] 0 tests.
   [  FAILED  ] 4 tests.
   
   Invalid: Offset invariant failure: offset for slot 1 out of bounds: 8 > 2
   ```
   
   
   **What the fix does**
   
   Replaced the single memcpy for the offsets buffer with a loop that subtracts 
offsets[0] as a base from each value
   so the output offsets are always normalized to start at 0.
   
   Then changed the data copy to start from data + base instead of data
   so only the bytes belonging to the slice are copied.
   
   The same two changes are applied symmetrically in both the ASA and AAS paths.
   
   
   **Tests after fix**
   ```
   [==========] 416 tests from 132 test suites ran. (31991 ms total)
   [  PASSED  ] 416 tests.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to