Describe the bug, including details regarding any error messages, version, and platform.
DictionaryArray::dictionary() lazily initalizes an Array to wrap its ArrayData::dictionary, but does not explicitly synchronize this so another thread which happens to call the same array's dictionary() function would introduce a data race.
StructArray::field() does similar lazy initialization but does synchronize, so it should be usable as a reference for fixing this.
See also discussion here: https://github.com/apache/arrow/pull/36418/files/e7196196b7262bb3988ac35347a94e7b41c22ce8#r1248319000
Component(s)
C++
Describe the bug, including details regarding any error messages, version, and platform.
DictionaryArray::dictionary() lazily initalizes an Array to wrap its
ArrayData::dictionary, but does not explicitly synchronize this so another thread which happens to call the same array'sdictionary()function would introduce a data race.StructArray::field() does similar lazy initialization but does synchronize, so it should be usable as a reference for fixing this.
See also discussion here: https://github.com/apache/arrow/pull/36418/files/e7196196b7262bb3988ac35347a94e7b41c22ce8#r1248319000
Component(s)
C++