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 09:03:06 UTC

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

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



##########
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:
       Probably could be simplified a bit by using `value.as_str()` directly and pattern match or use `map` on the resulting value`




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