zeroshade commented on issue #37976:
URL: https://github.com/apache/arrow/issues/37976#issuecomment-1743726446

   Is there a particular reason you need them all as a single record rather 
than just being able to treat the entire group of records as a single table via 
`NewTableFromRecords` ?
   
   If you absolutely have to concatenate them, my recommendation would be to 
call 
https://pkg.go.dev/github.com/apache/arrow/go/[email protected]/arrow/array#RecordToStructArray
 on each record, then use 
https://pkg.go.dev/github.com/apache/arrow/go/[email protected]/arrow/array#Concatenate
 to concatenate them all together, and finally 
https://pkg.go.dev/github.com/apache/arrow/go/[email protected]/arrow/array#RecordFromStructArray
 to get the record back out. 
   
   That's probably the simplest and most efficient way to concatenate if you 
absolutely *must* concatenate them. But I recommend seeing if using an 
`arrow.Table` is sufficient for your usage and avoid the memory allocations and 
copies unless you *absolutely* must have the entire thing as a single 
contiguous record batch (which in the vast majority of scenarios, you don't 
really need that and a table is sufficient).


-- 
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]

Reply via email to