bkietz commented on pull request #9471: URL: https://github.com/apache/arrow/pull/9471#issuecomment-779944257
In the first place IIUC the above test case is legal within the arrow format: ['Array slots which are null are not required to have a particular value; any "masked" memory can have any value'](https://github.com/apache/arrow/blob/95ba619a69ac0c0e1457c6f359798cad65ce26cf/docs/source/format/Columnar.rst#L216-L217). Given an array with indeterminate values underneath a null slot, it is indeed expected that the compare kernel will produce indeterminate bits. However this should not trigger valgrind unless one of those indeterminate bits is branched on, which should never happen since they are also masked by null bits and so may not be accessed. As for why [this test case](https://github.com/bkietz/arrow/blob/36352c44fda0000793007bd9407dcf39e59f85bf/cpp/src/arrow/compute/kernels/scalar_compare_test.cc#L512-L514) generated indeterminate values: when casting to pre-allocatable types like `uint8` from `null`, we don't initialize the values buffer. We could change this and ensure that casting from null will always produce well-defined values under null bits, but that seems unnecessary. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org