hi Antoine, The latter is correct, or at least what is intended in the specification.
For example, if the type metadata indices codes [0, 5, 10], then the "types" buffer should contain values selected from these values rather than physical child indexes (which would be [0, 1, 2] in this case) Thanks On Thu, Nov 21, 2019 at 9:51 AM Antoine Pitrou <anto...@python.org> wrote: > > > Hello, > > There's some ambiguity whether a union array's "types" buffer stores > physical child ids, or logical type codes. > > Some of our C++ tests assume the former: > https://github.com/apache/arrow/blob/master/cpp/src/arrow/array_union_test.cc#L107-L123 > > Some of our C++ tests assume the latter: > https://github.com/apache/arrow/blob/master/cpp/src/arrow/array_union_test.cc#L311-L326 > https://github.com/apache/arrow/blob/master/cpp/src/arrow/ipc/json_simple_test.cc#L943-L955 > > Critically, no validation of union data is currently implemented in C++ > (ARROW-6157). I can't parse the Java source code. > > Regards > > Antoine. >