[ 
https://issues.apache.org/jira/browse/ARROW-1491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16280623#comment-16280623
 ] 

ASF GitHub Bot commented on ARROW-1491:
---------------------------------------

wesm 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_r155318929
 
 

 ##########
 File path: cpp/src/arrow/compute/compute-test.cc
 ##########
 @@ -769,6 +769,65 @@ TEST_F(TestCast, OffsetOutputBuffer) {
                                                                 int16(), e3);
 }
 
+TEST_F(TestCast, StringToBoolean) {
+  CastOptions options;
+
+  vector<bool> is_valid = {true, true, true, true, true};
+
+  vector<std::string> v1 = {"False", "true", "true", "True", "false"};
+  vector<std::string> v2 = {"0", "1", "1", "1", "0"};
+  vector<bool> e = {false, true, true, true, false};
+  CheckCase<StringType, std::string, BooleanType, bool>(utf8(), v1, is_valid, 
boolean(),
+                                                        e, options);
+  CheckCase<StringType, std::string, BooleanType, bool>(utf8(), v2, is_valid, 
boolean(),
+                                                        e, options);
+}
+
+TEST_F(TestCast, StringToNumber) {
+  CastOptions options;
+
+  vector<bool> is_valid = {true, true, true, true, true};
 
 Review comment:
   Can you modify the unit tests to propagate nulls? 

----------------------------------------------------------------
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
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to