You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2024/03/16 07:02:06 UTC

(arrow-experiments) branch main updated: Simplify Ruby client example (#22)

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-experiments.git


The following commit(s) were added to refs/heads/main by this push:
     new 69a054a  Simplify Ruby client example (#22)
69a054a is described below

commit 69a054aebda269399534fb9503f8592b7df9c27d
Author: Ian Cook <ia...@gmail.com>
AuthorDate: Sat Mar 16 03:02:00 2024 -0400

    Simplify Ruby client example (#22)
---
 http/get_simple/ruby/client/client.rb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/http/get_simple/ruby/client/client.rb b/http/get_simple/ruby/client/client.rb
index a608bb5..c60202d 100644
--- a/http/get_simple/ruby/client/client.rb
+++ b/http/get_simple/ruby/client/client.rb
@@ -21,11 +21,8 @@ require "arrow"
 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)
 elapsed_time = Time.now - start
 
 n_received_record_batches = table[0].data.n_chunks