-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-14111: [C++] Add extraction function support for time32/time64 #11229
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a couple suggestions.
if (timezone.empty()) { | ||
std::string timezone; | ||
bool is_timestamp = type.id() == Type::TIMESTAMP; | ||
if (is_timestamp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could make this a compile-time check:
arrow/cpp/src/arrow/type_traits.h
Line 703 in 78ac132
using is_timestamp_type = std::is_base_of<TimestampType, T>; |
Then presumably any timestamp-related code would get optimized out for the non-timestamp specializations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Changed, please check if it makes sense.
&options_hms); | ||
CheckScalarUnary("strftime", time32(TimeUnit::MILLI), times_ms, utf8(), strftime_ms, | ||
&options_hms); | ||
CheckScalarUnary("strftime", time32(TimeUnit::SECOND), times_s, utf8(), strftime_s, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we 1) check what happens for fields like year, and 2) check that %z
isn't allowed for times below in StrftimeNoTimezone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
@lidavidm thanks for the review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates.
Thanks @lidavidm ! :) |
This is to resolve [ARROW-14111](https://issues.apache.org/jira/browse/ARROW-14111) Closes apache#11229 from rok/ARROW-14111 Authored-by: Rok <rok@mihevc.org> Signed-off-by: David Li <li.davidm96@gmail.com>
This is to resolve ARROW-14111