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 2020/11/21 14:16:39 UTC

[GitHub] [arrow] Dandandan commented on a change in pull request #8714: ARROW-10654: [Rust] Specialize parsing of floats / bools in CSV Reader

Dandandan commented on a change in pull request #8714:
URL: https://github.com/apache/arrow/pull/8714#discussion_r528201133



##########
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> {

Review comment:
       Yes, the mixed case is to keep compatibility with the previous implementation.
   
   Could as well have specific cases for all caps / capitalized booleans instead maybe? That would avoid accepting tRue etc.




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