pitrou commented on a change in pull request #11358:
URL: https://github.com/apache/arrow/pull/11358#discussion_r744867145
##########
File path: cpp/src/arrow/compute/kernels/scalar_string.cc
##########
@@ -3625,11 +3625,24 @@ struct StrptimeExec {
Result<ValueDescr> ResolveStrptimeOutput(KernelContext* ctx,
const std::vector<ValueDescr>&) {
- if (ctx->state()) {
- return ::arrow::timestamp(StrptimeState::Get(ctx).unit);
+ if (!ctx->state()) {
+ return Status::Invalid("strptime does not provide default
StrptimeOptions");
+ }
+ const StrptimeOptions& options = StrptimeState::Get(ctx);
+ // Check for use of %z or %Z
+ size_t cur = 0;
+ std::string zone = "";
+ while (cur < options.format.size() - 1) {
+ if (options.format[cur] == '%') {
+ if (cur + 1 < options.format.size() && options.format[cur + 1] == 'z') {
Review comment:
The first condition should be superfluous now :-)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]