diff --git a/c_glib/arrow-glib/basic-array.cpp b/c_glib/arrow-glib/basic-array.cpp index 45ff4c1cae96..a60c589788fe 100644 --- a/c_glib/arrow-glib/basic-array.cpp +++ b/c_glib/arrow-glib/basic-array.cpp @@ -128,12 +128,12 @@ G_BEGIN_DECLS * string data. If you don't have Arrow format data, you need to * use #GArrowLargeStringArrayBuilder to create a new array. * - * #GArrayBinaryViewArray is a class for variable-size binary view array. + * #GArrowBinaryViewArray is a class for variable-size binary view array. * It can store zero or more binary view data. If you don't have Arrow * format data, you need to use #GArrowBinaryViewArrayBuilder to create * a new array. * - * #GArrayStringViewArray is a class for variable-size string view array. + * #GArrowStringViewArray is a class for variable-size string view array. * It can store zero or more string view data. If you don't have Arrow * format data, you need to use #GArrowStringViewArrayBuilder to create * a new array. @@ -4140,6 +4140,9 @@ garrow_array_new_raw_valist(std::shared_ptr *arrow_array, case arrow::Type::type::RUN_END_ENCODED: type = GARROW_TYPE_RUN_END_ENCODED_ARRAY; break; + case arrow::Type::type::STRING_VIEW: + type = GARROW_TYPE_STRING_VIEW_ARRAY; + break; case arrow::Type::type::BINARY_VIEW: type = GARROW_TYPE_BINARY_VIEW_ARRAY; break; diff --git a/c_glib/test/test-cast.rb b/c_glib/test/test-cast.rb index 528a0e8c1c5c..e3180b200c06 100644 --- a/c_glib/test/test-cast.rb +++ b/c_glib/test/test-cast.rb @@ -142,4 +142,19 @@ def test_true build_binary_array(["\xff"]).cast(string_data_type, options)) end end + + def test_string_view + values = ["a", nil, "b"] + string_view_data_type = Arrow::StringViewDataType.new + array = build_string_array(values).cast(string_view_data_type) + actual_values = array.length.times.collect do |i| + if array.null?(i) + nil + else + array.get_value(i).to_s + end + end + assert_equal([Arrow::StringViewArray, values], + [array.class, actual_values]) + end end