You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zanmato1984 (via GitHub)" <gi...@apache.org> on 2023/12/19 07:29:09 UTC

Re: [I] [C++] "case_when" test failure on random union inputs [arrow]

zanmato1984 commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1862252174

   Looked a bit. The error message is
   ```
   '::arrow::internal::ValidateArrayFull(output)' failed with Invalid: Union value at position 0 has invalid type id 0
   ```
   , assuming this is the error that this issue encoutered.
   
   The reason of this failure is:
   1. The random array generation for union types doesn't take count the type code specified in the `UnionDataType` object: https://github.com/apache/arrow/blob/0552217efa4ba0a1a1a7857a86c92278ecf129c8/cpp/src/arrow/testing/random.cc#L897
   2. The function `case_when` executes fine because the type id generation is also trivial
   https://github.com/apache/arrow/blob/0552217efa4ba0a1a1a7857a86c92278ecf129c8/cpp/src/arrow/testing/random.cc#L901
   3. Finally a full validation is conducted on the function output
   https://github.com/apache/arrow/blob/0552217efa4ba0a1a1a7857a86c92278ecf129c8/cpp/src/arrow/compute/kernels/test_util.cc#L320
   , which checks if type ids in the buffer match the ones specified in the data type (and they don't)
   https://github.com/apache/arrow/blob/0552217efa4ba0a1a1a7857a86c92278ecf129c8/cpp/src/arrow/array/validate.cc#L362
   
   I think I can take this and make random array generation respect the type ids specified in the data type, instead of generating trivial type ids.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org