| 36 | end |
| 37 | |
| 38 | def test_string |
| 39 | array = build_string_array(["Ruby", "Python", "Ruby"]) |
| 40 | fields = [ |
| 41 | Arrow::Field.new("values", Arrow::StringDataType.new), |
| 42 | Arrow::Field.new("counts", Arrow::Int64DataType.new), |
| 43 | ] |
| 44 | structs = [ |
| 45 | {"values" => "Ruby", "counts" => 2}, |
| 46 | {"values" => "Python", "counts" => 1}, |
| 47 | ] |
| 48 | assert_equal(build_struct_array(fields, structs), |
| 49 | array.count_values) |
| 50 | end |
| 51 | end |