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

[GitHub] [arrow-rs] wangrunji0408 opened a new pull request, #3724: fix: encoding batch with no columns

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

   # 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.
   -->
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   When encoding a `RecordBatch` with no columns, the `FlightDataEncoder` will return an error:
   ```
   Arrow(InvalidArgumentError("must either specify a row count or at least one column"))
   ```
   
   This PR fixes this problem.
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Use `RecordBatch::try_new_with_options` to allow constructing a batch with no columns.
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   
   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 commented on pull request #3724: fix: encoding batch with no columns

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

   Thank you


-- 
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] viirya commented on a diff in pull request #3724: fix: encoding batch with no columns

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


##########
arrow-flight/src/encode.rs:
##########
@@ -499,6 +502,19 @@ mod tests {
         );
     }
 
+    #[test]
+    fn test_encode_no_column_batch() {
+        let batch = RecordBatch::try_new_with_options(
+            Arc::new(Schema::empty()),
+            vec![],
+            &RecordBatchOptions::new().with_row_count(Some(10)),
+        )
+        .expect("cannot create record batch");
+
+        prepare_batch_for_flight(&batch, batch.schema().clone())
+            .expect("failed to optimize");

Review Comment:
   ```suggestion
           prepare_batch_for_flight(&batch, batch.schema())
               .expect("failed to optimize");
   ```



-- 
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] viirya commented on pull request #3724: fix: encoding batch with no columns

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

   Thank you!


-- 
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] viirya merged pull request #3724: fix: encoding batch with no columns

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


-- 
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] ursabot commented on pull request #3724: fix: encoding batch with no columns

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

   Benchmark runs are scheduled for baseline = 59016e53e5cfa1d368009ed640d1f3dce326e7bb and contender = ea48b9571f88bfbced60f9790ae2a7102502870e. ea48b9571f88bfbced60f9790ae2a7102502870e is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/dff8878acd8c4b8d8c08937e4062b1b7...8e30bcf129f54c0496ea559be571ecf2/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/4c7fed914a9b49889baa1ce6427b7877...d1a5b6d8d25042eea2e53cec4258a8fa/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/9ed5bd4327434e668a7d5788a77afc11...dfb83003de9f4492ac5611dccf728e10/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/24fdf85afb834918a62fbc7733132a5c...8c0d09976e134cf48d14092e33aabfef/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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] viirya commented on a diff in pull request #3724: fix: encoding batch with no columns

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


##########
arrow-flight/src/encode.rs:
##########
@@ -499,6 +502,19 @@ mod tests {
         );
     }
 
+    #[test]
+    fn test_encode_no_column_batch() {
+        let batch = RecordBatch::try_new_with_options(
+            Arc::new(Schema::empty()),
+            vec![],
+            &RecordBatchOptions::new().with_row_count(Some(10)),
+        )
+        .expect("cannot create record batch");
+
+        prepare_batch_for_flight(&batch, batch.schema())
+            .expect("failed to optimize");

Review Comment:
   ```suggestion
           prepare_batch_for_flight(&batch, batch.schema()).expect("failed to optimize");
   ```



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