alamb commented on a change in pull request #8714:
URL: https://github.com/apache/arrow/pull/8714#discussion_r528328592
##########
File path: rust/arrow/src/csv/reader.rs
##########
@@ -446,8 +446,57 @@ fn parse(
arrays.and_then(|arr| RecordBatch::try_new(projected_schema, arr))
}
+trait Parser: ArrowPrimitiveType {
+ fn parse(string: &str) -> Option<Self::Native> {
+ string.parse::<Self::Native>().ok()
+ }
+}
+
+impl Parser for BooleanType {
+ fn parse(string: &str) -> Option<bool> {
+ if string == "false" || string == "FALSE" || string == "False" {
+ return Some(true);
Review comment:
https://github.com/apache/arrow/pull/8733
##########
File path: rust/arrow/src/csv/reader.rs
##########
@@ -446,8 +446,57 @@ fn parse(
arrays.and_then(|arr| RecordBatch::try_new(projected_schema, arr))
}
+trait Parser: ArrowPrimitiveType {
+ fn parse(string: &str) -> Option<Self::Native> {
+ string.parse::<Self::Native>().ok()
+ }
+}
+
+impl Parser for BooleanType {
+ fn parse(string: &str) -> Option<bool> {
+ if string == "false" || string == "FALSE" || string == "False" {
+ return Some(true);
Review comment:
I totally missed this, but this line has a bug parsing in this field
appears to be backwards -- `"false"` seems to return `true` -- it looks like it
got added in
https://github.com/apache/arrow/pull/8714/commits/52bf0e839453749d1f042572a5e264b701e16904
-- FYI @Dandandan and @nevi-me -- I have a fix for it shortly
----------------------------------------------------------------
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:
[email protected]