Class: Arrow::RecordBatch
- Inherits:
-
Object
- Object
- Arrow::RecordBatch
show all
- Includes:
- RecordContainable, Enumerable
- Defined in:
- lib/arrow/record-batch.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#each_column, #each_record, #find_column
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
62
63
64
65
66
67
68
|
# File 'lib/arrow/record-batch.rb', line 62
def method_missing(name, *args, &block)
if args.empty?
column = find_column(name)
return column if column
end
super
end
|
Class Method Details
.new(*args) ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/arrow/record-batch.rb', line 26
def new(*args)
n_args = args.size
case n_args
when 2
schema, data = args
RecordBatchBuilder.build(schema, data)
when 3
super
else
message = "wrong number of arguments (given #{n_args}, expected 2..3)"
raise ArgumentError, message
end
end
|
Instance Method Details
#columns ⇒ Object
44
45
46
|
# File 'lib/arrow/record-batch.rb', line 44
def columns
@columns ||= columns_raw
end
|
#columns_raw ⇒ Object
43
|
# File 'lib/arrow/record-batch.rb', line 43
alias_method :columns_raw, :columns
|
#respond_to_missing?(name, include_private) ⇒ Boolean
57
58
59
60
|
# File 'lib/arrow/record-batch.rb', line 57
def respond_to_missing?(name, include_private)
return true if find_column(name)
super
end
|
Converts the record batch to Table.
53
54
55
|
# File 'lib/arrow/record-batch.rb', line 53
def to_table
Table.new(schema, [self])
end
|