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 2022/02/13 17:18:59 UTC

[GitHub] [arrow-rs] sum12 commented on a change in pull request #1301: Json formatted datetime parsing

sum12 commented on a change in pull request #1301:
URL: https://github.com/apache/arrow-rs/pull/1301#discussion_r805389418



##########
File path: arrow/src/json/reader.rs
##########
@@ -942,6 +943,32 @@ impl Decoder {
         ))
     }
 
+    #[allow(clippy::unnecessary_wraps)]
+    fn build_primitive_array_using_format_string<T>(
+        &self,
+        rows: &[Value],
+        col_name: &str,
+        format_string: &str,
+    ) -> Result<ArrayRef>
+    where
+        T: ArrowNumericType + Parser,
+        T::Native: num::NumCast,
+    {
+        Ok(Arc::new(
+            rows.iter()
+                .map(|row| {
+                    row.get(&col_name).and_then(|value| {
+                        if value.is_string() {

Review comment:
       Thanks ! I ended up using `and_then` to avoid calling `flatten`. it definitely looks cleaner




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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

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