You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/08 08:38:15 UTC

[GitHub] [arrow] projjal commented on pull request #9877: ARROW-12189: [C++][Gandiva] Implement TO_TIME([string] given_text, [literal_string] format) and TO_TIMESTAMP([string] given_text, [literal_string] format) and UNIX_TIMESTAMP functions

projjal commented on pull request #9877:
URL: https://github.com/apache/arrow/pull/9877#issuecomment-815571670


   > @projjal I found a limitation in the [arrow method](https://github.com/apache/arrow/blob/c2adaad3855a470c33b24189641008726ee63eed/cpp/src/arrow/util/value_parsing.h#L663) to convert string to dates and times using a defined format. That method calls the strptime method, which does not have an option to format sub-second granularities like milliseconds and microseconds, so if a user defines a format like YYYY-MM-DD HH:MI:SS.FFF, an error will be raised when the program tries to parse the date.
   > 
   > [This example in the Pull Request](https://github.com/apache/arrow/blob/c2adaad3855a470c33b24189641008726ee63eed/cpp/src/gandiva/to_timestamp_holder_test.cc#L78) shows the error that occurs when I try to parse a date using milliseconds in the format string.
   > 
   > Do I need to correct that problem in this Pull Request? Or it is better to create a new PR to deal with the limitation and send the Pull Request with the possibility to format date, time and timestamps until the second time granularity now?
   
   Would be better to correct it as part of this PR if possible


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org