stenlarsson opened a new issue, #35681:
URL: https://github.com/apache/arrow/issues/35681
### Describe the bug, including details regarding any error messages,
version, and platform.
In some situations we end up with an empty table. When trying to create a
new table based on this it crashes. Here is the simplest example I can think of:
```ruby
require 'arrow'
array = Arrow::Int64DataType.new.build_array([1])
table = Arrow::Table.new('foo' => array)
empty_table = table.filter([false])
empty_table.select_columns('foo')
```
This results in the following exception:
```
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:689:in
`invoke': [chunked-array][combine]: Invalid: Must pass at least one array
(Arrow::Error::Invalid)
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:689:in
`invoke'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:560:in
`combine'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/red-arrow-11.0.0/lib/arrow/chunked-array.rb:32:in
`to_arrow_array'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/red-arrow-11.0.0/lib/arrow/array.rb:53:in
`try_convert'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/registered-type-info.rb:31:in
`try_convert'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-tag.rb:172:in
`try_convert_interface'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-tag.rb:22:in
`try_convert'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-info.rb:20:in
`try_convert'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-tag.rb:120:in
`block in try_convert_array_like'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-tag.rb:118:in
`collect'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-tag.rb:118:in
`try_convert_array_like'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-tag.rb:146:in
`try_convert_array'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-tag.rb:22:in
`try_convert'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/type-info.rb:20:in
`try_convert'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:777:in
`block in normalize_arguments!'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:774:in
`times'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:774:in
`normalize_arguments!'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:679:in
`invoke'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:347:in
`block (2 levels) in initialize'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:346:in
`catch'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:346:in
`block in initialize'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:345:in
`each'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/gobject-introspection-4.1.2/lib/gobject-introspection/loader.rb:345:in
`initialize'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/red-arrow-11.0.0/lib/arrow/table.rb:184:in
`initialize'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/red-arrow-11.0.0/lib/arrow/column-containable.rb:102:in
`new'
from
/Users/stenlarsson/.rbenv/versions/3.0.5/lib/ruby/gems/3.0.0/gems/red-arrow-11.0.0/lib/arrow/column-containable.rb:102:in
`select_columns'
from empty_table_bug.rb:6:in `<main>'
```
What happens here is that we end up with a `ChunkedArray` with no `Array`s
inside, and you are not allowed to call `combine` on it. Note that this doesn't
happen if you have a `ChunkedArray` with one empty array.
### Component(s)
Ruby
--
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]