@@ -390,8 +390,23 @@ test_that("Table converts dictionary arrays with wider index types back to R", {
390390test_that(" Table converts dictionary arrays with string_view values" , {
391391 expected <- data.frame (foo = factor (c(" x" , " y" , " x" )))
392392 tab <- Table $ create(expected , schema = schema(foo = dictionary(uint32(), string_view())))
393+ expect_equal_data_frame(tab , expected )
394+
395+ # with NAs
396+ expected_na <- data.frame (foo = factor (c(" x" , NA , " x" )))
397+ tab_na <- Table $ create(expected_na , schema = schema(foo = dictionary(uint32(), string_view())))
398+ expect_equal_data_frame(tab_na , expected_na )
399+ })
393400
401+ test_that(" Table round-trips string_view columns" , {
402+ expected <- data.frame (x = c(" hello" , " world" , " " ))
403+ tab <- Table $ create(expected , schema = schema(x = string_view()))
394404 expect_equal_data_frame(tab , expected )
405+
406+ # with NAs
407+ expected_na <- data.frame (x = c(" hello" , NA , " " ))
408+ tab_na <- Table $ create(expected_na , schema = schema(x = string_view()))
409+ expect_equal_data_frame(tab_na , expected_na )
395410})
396411
397412test_that(" Table unifies dictionary on conversion back to R (ARROW-8374)" , {
0 commit comments