Class: Arrow::RecordBatchReader

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/record-batch-reader.rb

Class Method Summary collapse

Class Method Details

.try_convert(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/arrow/record-batch-reader.rb', line 22

def try_convert(value)
  case value
  when ::Array
    return nil if value.empty?
    if value.all? {|v| v.is_a?(RecordBatch)}
      new(value)
    else
      nil
    end
  when RecordBatch
    new([value])
  when Table
    TableBatchReader.new(value)
  else
    nil
  end
end