You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "ianmcook (via GitHub)" <gi...@apache.org> on 2024/03/15 14:36:55 UTC

[PR] Simplify basic Ruby HTTP GET client example [arrow-experiments]

ianmcook opened a new pull request, #22:
URL: https://github.com/apache/arrow-experiments/pull/22

   (no comment)


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


Re: [PR] Simplify basic Ruby HTTP GET client example [arrow-experiments]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #22:
URL: https://github.com/apache/arrow-experiments/pull/22#discussion_r1527120011


##########
http/get_simple/ruby/client/client.rb:
##########
@@ -21,11 +21,8 @@
 uri = URI("http://localhost:8008")
 
 start = Time.now
-arrows_data = Net::HTTP.get(uri)
-input = Arrow::BufferInputStream.new(arrows_data)
-reader = Arrow::RecordBatchStreamReader.new(input)
-schema = reader.schema
-table = reader.read_all
+arrows_data = Net::HTTP.get(uri).freeze
+table = Arrow::Table.load(Arrow::Buffer.new(arrows_data), format: :arrows)

Review Comment:
   Right!



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


Re: [PR] Simplify basic Ruby HTTP GET client example [arrow-experiments]

Posted by "ianmcook (via GitHub)" <gi...@apache.org>.
ianmcook commented on code in PR #22:
URL: https://github.com/apache/arrow-experiments/pull/22#discussion_r1526395028


##########
http/get_simple/ruby/client/client.rb:
##########
@@ -21,11 +21,8 @@
 uri = URI("http://localhost:8008")
 
 start = Time.now
-arrows_data = Net::HTTP.get(uri)
-input = Arrow::BufferInputStream.new(arrows_data)
-reader = Arrow::RecordBatchStreamReader.new(input)
-schema = reader.schema
-table = reader.read_all
+arrows_data = Net::HTTP.get(uri).freeze
+table = Arrow::Table.load(Arrow::Buffer.new(arrows_data), format: :arrows)

Review Comment:
   You can get the schema from `table.schema`.



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


Re: [PR] Simplify basic Ruby HTTP GET client example [arrow-experiments]

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


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