headius commented on issue #35589:
URL: https://github.com/apache/arrow/issues/35589#issuecomment-1548017361
Ok here's the JRuby version of the simple vector example. I'm trying to work
out the best way to pull the jars and make it easily runnable for you:
```ruby
java_import org.apache.arrow.memory.RootAllocator
java_import org.apache.arrow.vector.IntVector
begin
allocator = RootAllocator.new
int_vector = IntVector.new("fixed-size-primitive-layout", allocator)
int_vector.allocate_new(3)
int_vector.set(0,1)
int_vector.set_null(1)
int_vector.set(2,2)
int_vector.set_value_count(3);
puts "Vector created in memory: #{int_vector}"
ensure
int_vector.close rescue nil
allocator.close rescue nil
end
```
When all necessary dependency jars are loaded (into JRuby via CLASSPATH env
or `require` each jar), this should work.
--
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]