rbhive 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rbhive/connection.rb +7 -0
- metadata +2 -2
data/lib/rbhive/connection.rb
CHANGED
@@ -74,6 +74,13 @@ module RBHive
|
|
74
74
|
ResultSet.new(client.fetchAll)
|
75
75
|
end
|
76
76
|
|
77
|
+
def fetch_in_batch(query, batch_size=100)
|
78
|
+
execute(query)
|
79
|
+
until (next_batch = client.fetchN(batch_size)).empty?
|
80
|
+
yield next_batch
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
77
84
|
def first(query)
|
78
85
|
execute(query)
|
79
86
|
ResultSet.new([client.fetchOne])
|