You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "doki23 (via GitHub)" <gi...@apache.org> on 2023/03/24 02:37:40 UTC

[GitHub] [arrow-rs] doki23 opened a new pull request, #3924: fix bug of batches to json

doki23 opened a new pull request, #3924:
URL: https://github.com/apache/arrow-rs/pull/3924

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes apache/arrow-datafusion#5635.
   
   # Rationale for this change
   `record_batches_to_json_rows` doesn't process multi batches as expected.
   
   # Are there any user-facing changes?
   No
   


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


[GitHub] [arrow-rs] tustvold merged pull request #3924: Fix JSON Temporal Encoding of Multiple Batches

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #3924:
URL: https://github.com/apache/arrow-rs/pull/3924


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


[GitHub] [arrow-rs] doki23 commented on a diff in pull request #3924: fix bug of batches to json

Posted by "doki23 (via GitHub)" <gi...@apache.org>.
doki23 commented on code in PR #3924:
URL: https://github.com/apache/arrow-rs/pull/3924#discussion_r1147071954


##########
arrow-json/src/writer.rs:
##########
@@ -302,14 +302,17 @@ fn set_column_for_json_rows(
             let options = FormatOptions::default();
             let formatter = ArrayFormatter::try_new(array.as_ref(), &options)?;
             let data = array.data();
-            rows.iter_mut().enumerate().for_each(|(idx, row)| {
-                if data.is_valid(idx) {
-                    row.insert(
-                        col_name.to_string(),
-                        formatter.value(idx).to_string().into(),
-                    );
-                }
-            });
+            rows.iter_mut()
+                .take(row_count)

Review Comment:
   this is the bug fix



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


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3924: fix bug of batches to json

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #3924:
URL: https://github.com/apache/arrow-rs/pull/3924#discussion_r1147190816


##########
arrow-json/src/writer.rs:
##########
@@ -1442,4 +1445,51 @@ mod tests {
             assert_eq!(serde_json::from_str::<Value>(r).unwrap(), expected_json,);
         }
     }
+
+    #[test]
+    #[allow(deprecated)]

Review Comment:
   Could we rework this to use the RawReader pleasr, I hope to delete the old logic in the next release



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


[GitHub] [arrow-rs] alamb commented on pull request #3924: Fix JSON Temporal Encoding of Multiple Batches

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #3924:
URL: https://github.com/apache/arrow-rs/pull/3924#issuecomment-1483237195

   Thank you @doki23  -- very nice find


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


[GitHub] [arrow-rs] doki23 commented on a diff in pull request #3924: fix bug of batches to json

Posted by "doki23 (via GitHub)" <gi...@apache.org>.
doki23 commented on code in PR #3924:
URL: https://github.com/apache/arrow-rs/pull/3924#discussion_r1147760317


##########
arrow-json/src/writer.rs:
##########
@@ -1442,4 +1445,51 @@ mod tests {
             assert_eq!(serde_json::from_str::<Value>(r).unwrap(), expected_json,);
         }
     }
+
+    #[test]
+    #[allow(deprecated)]

Review Comment:
   Resolved @tustvold 



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