You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] "case_when" test failure on random union inputs #15192
I found that we can bring the test back alive by simply removing passing customized type codes, drafted here: #39308
And I think it's acceptable for this specific case because the case is about testing case_when rather than the "type code mapping" thing for union types.
Of course this will leave the potential issue of mismatched type codes between in data type and actual data unchanged. So I'm also open to do a thorough change, i.e., making random union array generation respect the type ids specified in the data type.
Any comments will be helpful. Thanks.
cc @pitrou
One quick question:
In order to generate conformant type ids for random union array, I'll have to pass either UnionDataType or type codes into the following functions:
However they seem to be public APIs, even though they belong to arrow-testing library. Do I have to make overloads of them or am I free to change the signatures?
I appreciate if you can enlighten me about this? Thanks @pitrou !
Activity
pitrou commentedon Jan 4, 2023
cc @wjones127 @lidavidm
pitrou commentedon Jan 4, 2023
(#15131 is needed to reproduce)
zanmato1984 commentedon Dec 19, 2023
Looked a bit. The error message is
, assuming this is the error that this issue encountered.
The reason of this failure is:
UnionDataTypeobject:arrow/cpp/src/arrow/testing/random.cc
Line 897 in 0552217
case_whenexecutes fine because the type id generation is also trivialarrow/cpp/src/arrow/testing/random.cc
Line 901 in 0552217
arrow/cpp/src/arrow/compute/kernels/test_util.cc
Line 320 in 0552217
, which checks if type ids in the buffer match the ones specified in the data type (and they don't)
arrow/cpp/src/arrow/array/validate.cc
Line 362 in 0552217
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.
zanmato1984 commentedon Dec 19, 2023
I found that we can bring the test back alive by simply removing passing customized type codes, drafted here: #39308
And I think it's acceptable for this specific case because the case is about testing
case_whenrather than the "type code mapping" thing for union types.Of course this will leave the potential issue of mismatched type codes between in data type and actual data unchanged. So I'm also open to do a thorough change, i.e., making random union array generation respect the type ids specified in the data type.
Any comments will be helpful. Thanks.
cc @pitrou
pitrou commentedon Dec 20, 2023
@zanmato1984 Thanks for the investigation! I think it would be better to make random union array generation conformant, indeed.
zanmato1984 commentedon Dec 20, 2023
Sure, will do. Thanks @pitrou !
zanmato1984 commentedon Dec 20, 2023
One quick question:
In order to generate conformant type ids for random union array, I'll have to pass either
UnionDataTypeor type codes into the following functions:arrow/cpp/src/arrow/testing/random.h
Lines 535 to 537 in 91b2243
arrow/cpp/src/arrow/testing/random.h
Lines 549 to 551 in 91b2243
However they seem to be public APIs, even though they belong to arrow-testing library. Do I have to make overloads of them or am I free to change the signatures?
I appreciate if you can enlighten me about this? Thanks @pitrou !
pitrou commentedon Dec 20, 2023
arrow-testing is not really for public usage, so you can change those APIs.
zanmato1984 commentedon Dec 21, 2023
Just found that #36018 already addressed the aforementioned problem. I made a mistake, my local branch was too old.
Now this test case can be brought back alive without other changes, updated in #39308.
So sad. And my apology for the unnecessary trouble :-(
GH-15192: [C++] Bring back `case_when` tests for union types (#39308)
apacheGH-15192: [C++] Bring back `case_when` tests for union types (a…