kou commented on code in PR #50226:
URL: https://github.com/apache/arrow/pull/50226#discussion_r3449285193
##########
ruby/red-arrow/lib/arrow/record-batch.rb:
##########
@@ -37,7 +37,12 @@ def new(*args)
super(schema, n_rows, values)
when 2
schema, data = args
- RecordBatchBuilder.build(schema, data)
+ schema = Schema.new(schema) unless schema.is_a?(Schema)
+ if !data.empty? && data.all? {|array| array.is_a?(Arrow::Array)}
Review Comment:
Could you use `and` not `&&` in this code base?
```suggestion
if !data.empty? and data.all? {|array| array.is_a?(Arrow::Array)}
```
##########
ruby/red-arrow/lib/arrow/record-batch.rb:
##########
@@ -135,6 +83,15 @@ def method_missing(name, *args, &block)
private
+ def create_merged_container(fields, arrays)
+ record_batch = self.class.new(
+ Schema.new(fields),
+ arrays,
+ )
+ share_input(record_batch)
+ record_batch
+ end
+
Review Comment:
Can we move this to `column_containable.rb` now?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]