You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "sgilmore10 (via GitHub)" <gi...@apache.org> on 2025/01/27 20:23:09 UTC
[I] [C++]: Identity cast for `Time64Scalar` and `Time32Scalar` fails [arrow]
sgilmore10 opened a new issue, #45362:
URL: https://github.com/apache/arrow/issues/45362
### Describe the bug, including details regarding any error messages, version, and platform.
The identity cast for `Time64Scalar` and `Time32Scalar` no longer works as of arrow version `16.1.0`.
If this executable:
```c++
#include "arrow/scalar.h"
#include "arrow/result.h"
#include "arrow/status.h"
#include <iostream>
arrow::Status test_scalar_cast() {
auto type = arrow::time64(arrow::TimeUnit::type::MICRO);//arrow::time64(arrow::TimeUnit::type::MICRO);
ARROW_ASSIGN_OR_RAISE(auto scalar, arrow::MakeScalar<int64_t>(type, int64_t(1e6)));
std::cout << "Casting from time64[us] scalar to time64[us] scalar..." << std::endl;
ARROW_ASSIGN_OR_RAISE(auto cast_result, scalar->CastTo(type));
return arrow::Status::OK();
}
int main(int argc, char *argv[]) {
auto status = test_scalar_cast();
if (!status.ok()) {
std::cout << "Cast failed with message: " << status.message() << std::endl;
} else {
std::cout << "Success!" << std::endl;
}
return 0;
}
```
is linked against arrow version `16.1.0`, the identity cast fails:
```bash
$ ./main
Casting from time64[us] scalar to time64[us] scalar...
Cast failed with message: casting scalars of type time64[us] to type time64[us]
```
However, if the executable is linked against arrow version `16.0.0`, the identity cast works as expected:
```bash
$ ./main
Casting from time64[us] scalar to time64[us] scalar...
Success!
```
I did some code archeology, and I believe this bug was introduced in #40237.
### 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
Re: [I] [C++]: Identity cast for `Time64Scalar` and `Time32Scalar` fails [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on issue #45362:
URL: https://github.com/apache/arrow/issues/45362#issuecomment-2636868593
Issue resolved by pull request 45370
https://github.com/apache/arrow/pull/45370
--
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++]: Identity cast for `Time64Scalar` and `Time32Scalar` fails [arrow]
Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on issue #45362:
URL: https://github.com/apache/arrow/issues/45362#issuecomment-2619613779
I'd like to take a fix here
--
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++]: Identity cast for `Time64Scalar` and `Time32Scalar` fails [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou closed issue #45362: [C++]: Identity cast for `Time64Scalar` and `Time32Scalar` fails
URL: https://github.com/apache/arrow/issues/45362
--
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