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

[GitHub] [arrow-rs] sundy-li opened a new pull request, #4144: Better flight SQL example codes

sundy-li opened a new pull request, #4144:
URL: https://github.com/apache/arrow-rs/pull/4144

   # 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 #.
   
   # Rationale for this change
    
   Provide more detail examples and test codes for flight SQL.
   
   # 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.
   -->
   
   # 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.
   -->
   


-- 
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 #4144: Better flight SQL example codes

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

   Working on updating this


-- 
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] sundy-li commented on pull request #4144: Better flight SQL example codes

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

   I profiled the test case `test_select_1` and found that prepare cause much more latency in TcpClient.
   
   ```
    cargo test --release --package arrow-flight --example flight_sql_server --all-features --features flight-sql-experimental --features tls -- tests::test_select_1 --exact --nocapture 
   
   running 1 test
   testing uds client
   prepare cost: 761.35µs
   execute cost: 671.36µs
   do get cost: 716.169µs
   Client finished!
   =======
   testing tcp client
   prepare cost: 41.503622ms
   execute cost: 1.55827ms
   do get cost: 1.58378ms
   Client finished!
   =======
   testing https client
   prepare cost: 1.39358ms
   execute cost: 1.31692ms
   do get cost: 1.354041ms
   Client finished!
   =======
   test tests::test_select_1 ... ok
   ```


-- 
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] sundy-li commented on pull request #4144: Better flight SQL example codes

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

   > no ideas about the reason.
   
   Oh, it's due to TcpNoDelay, it's not enabled.


-- 
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 #4144: Better flight SQL example codes

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


##########
arrow-flight/examples/flight_sql_server.rs:
##########
@@ -690,16 +648,89 @@ mod tests {
         }
     }
 
+    async fn test_tcp_client<F, C>(f: F)
+    where
+        F: FnOnce(FlightSqlServiceClient<Channel>) -> C,
+        C: Future<Output = ()>,
+    {
+        let addr = "127.0.0.1:50051";
+
+        // We would just listen on TCP, but it seems impossible to know when tonic is ready to serve

Review Comment:
   ```suggestion
   ```
   
   I believe the sleep below is to handle this



##########
arrow-flight/Cargo.toml:
##########
@@ -34,17 +34,37 @@ arrow-cast = { workspace = true }
 arrow-ipc = { workspace = true }
 arrow-schema = { workspace = true }
 base64 = { version = "0.21", default-features = false, features = ["std"] }
-tonic = { version = "0.9", default-features = false, features = ["transport", "codegen", "prost"] }
+tonic = { version = "0.9", default-features = false, features = [

Review Comment:
   I personally find this formatting harder to read...



##########
arrow-flight/examples/flight_sql_server.rs:
##########
@@ -690,16 +648,89 @@ mod tests {
         }
     }
 
+    async fn test_tcp_client<F, C>(f: F)
+    where
+        F: FnOnce(FlightSqlServiceClient<Channel>) -> C,
+        C: Future<Output = ()>,
+    {
+        let addr = "127.0.0.1:50051";

Review Comment:
   https://github.com/apache/arrow-rs/pull/4145 shows how this could be adapted to not need to hard-code a port



##########
arrow-flight/examples/flight_sql_server.rs:
##########
@@ -690,16 +648,89 @@ mod tests {
         }
     }
 
+    async fn test_tcp_client<F, C>(f: F)
+    where
+        F: FnOnce(FlightSqlServiceClient<Channel>) -> C,
+        C: Future<Output = ()>,
+    {
+        let addr = "127.0.0.1:50051";
+
+        // We would just listen on TCP, but it seems impossible to know when tonic is ready to serve
+        let service = FlightSqlServiceImpl {};
+        let serve_future = Server::builder()
+            .add_service(FlightServiceServer::new(service))
+            .serve(addr.parse().unwrap());
+
+        let request_future = async {
+            sleep(Duration::from_millis(2000)).await;

Review Comment:
   ```suggestion
               // wait for server to start up
               sleep(Duration::from_millis(2000)).await;
   ```



-- 
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 #4144: Better flight SQL example codes

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

   Thank you for this :+1: 


-- 
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 #4144: Better flight SQL example codes

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


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