You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/04 15:01:39 UTC
[GitHub] [arrow] pitrou opened a new issue, #15192: [C++] "case_when" test failure on random union inputs
pitrou opened a new issue, #15192:
URL: https://github.com/apache/arrow/issues/15192
### Describe the bug, including details regarding any error messages, version, and platform.
Enabling this commented out test in `scalar_if_else_test_.cc` produces test failures:
```c++
// TEST(TestCaseWhen, UnionBoolStringRandom) {
// for (const auto& type : std::vector<std::shared_ptr<DataType>>{
// sparse_union({field("a", boolean()), field("b", utf8())}, {2, 7}),
// dense_union({field("a", boolean()), field("b", utf8())}, {2, 7})}) {
// ARROW_SCOPED_TRACE(type->ToString());
// TestCaseWhenRandom(type);
// }
// }
```
### Component(s)
C++
--
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on issue #15192: [C++] "case_when" test failure on random union inputs
Posted by GitBox <gi...@apache.org>.
pitrou commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1371052909
(https://github.com/apache/arrow/pull/15131 is needed to reproduce)
--
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1863281341
I found that we can bring the test back alive by simply removing passing customized type codes, drafted here: https://github.com/apache/arrow/pull/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
--
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1865012706
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:
https://github.com/apache/arrow/blob/91b2243e2753bb1a4ccd645dd41d74b1d0b077c0/cpp/src/arrow/testing/random.h#L535-L537
https://github.com/apache/arrow/blob/91b2243e2753bb1a4ccd645dd41d74b1d0b077c0/cpp/src/arrow/testing/random.h#L549-L551
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 !
--
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou closed issue #15192: [C++] "case_when" test failure on random union inputs
URL: https://github.com/apache/arrow/issues/15192
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] pitrou commented on issue #15192: [C++] "case_when" test failure on random union inputs
Posted by GitBox <gi...@apache.org>.
pitrou commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1371052605
cc @wjones127 @lidavidm
--
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1865023693
arrow-testing is not really for public usage, so you can change those APIs.
--
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1864930719
> @zanmato1984 Thanks for the investigation! I think it would be better to make random union array generation conformant, indeed.
Sure, will do. Thanks @pitrou !
--
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1864527437
@zanmato1984 Thanks for the investigation! I think it would be better to make random union array generation conformant, indeed.
--
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
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
Re: [I] [C++] "case_when" test failure on random union inputs [arrow]
Posted by "zanmato1984 (via GitHub)" <gi...@apache.org>.
zanmato1984 commented on issue #15192:
URL: https://github.com/apache/arrow/issues/15192#issuecomment-1865424287
Just found that https://github.com/apache/arrow/pull/36018 already addressed this issue. 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 :-(
--
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