Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

rok
Copy link
Member

@rok rok commented Sep 24, 2021

This is to resolve ARROW-14111

@rok rok changed the title ARROW-14111 /[C++] Add extraction function support for time32/time64 ARROW-14111: [C++] Add extraction function support for time32/time64 Sep 24, 2021
@github-actions
Copy link

@github-actions
Copy link

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

Copy link
Member

@lidavidm lidavidm left a 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) {
Copy link
Member

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:

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.

Copy link
Member Author

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,
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@rok
Copy link
Member Author

rok commented Sep 25, 2021

@lidavidm thanks for the review :)
I've also updated the docs to reflect the new types.

Copy link
Member

@lidavidm lidavidm left a 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.

@lidavidm lidavidm closed this in d827c68 Sep 27, 2021
@rok
Copy link
Member Author

rok commented Sep 27, 2021

Thanks @lidavidm ! :)

ViniciusSouzaRoque pushed a commit to s1mbi0se/arrow that referenced this pull request Oct 20, 2021
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants