[
https://issues.apache.org/jira/browse/ARROW-1491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16348892#comment-16348892
]
ASF GitHub Bot commented on ARROW-1491:
---------------------------------------
cpcloud commented on a change in pull request #1387: ARROW-1491: [C++] Add
casting implementations from strings to numbers or boolean
URL: https://github.com/apache/arrow/pull/1387#discussion_r165416478
##########
File path: cpp/src/arrow/compute/kernels/cast.cc
##########
@@ -703,6 +706,106 @@ struct CastFunctor<T, DictionaryType,
}
};
+// ----------------------------------------------------------------------
+// String to Number
+
+template <typename T>
+typename std::enable_if<std::is_arithmetic<T>::value && !std::is_same<T,
int8_t>::value &&
+ !std::is_same<T, uint8_t>::value,
+ T>::type
+castStringToNumeric(const std::string& s) {
+ return boost::lexical_cast<T>(s);
+}
+
+template <typename T>
+typename std::enable_if<std::is_same<T, int8_t>::value || std::is_same<T,
uint8_t>::value,
+ T>::type
+castStringToNumeric(const std::string& s) {
Review comment:
Capitalize.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [C++] Add casting implementations from strings to numbers or boolean
> --------------------------------------------------------------------
>
> Key: ARROW-1491
> URL: https://issues.apache.org/jira/browse/ARROW-1491
> Project: Apache Arrow
> Issue Type: New Feature
> Components: C++
> Reporter: Wes McKinney
> Assignee: Licht Takeuchi
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.9.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)