You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Neal Richardson (Jira)" <ji...@apache.org> on 2019/11/01 20:47:00 UTC

[jira] [Created] (ARROW-7045) [R] Factor type not preserved in Parquet roundtrip

Neal Richardson created ARROW-7045:
--------------------------------------

             Summary: [R] Factor type not preserved in Parquet roundtrip
                 Key: ARROW-7045
                 URL: https://issues.apache.org/jira/browse/ARROW-7045
             Project: Apache Arrow
          Issue Type: Bug
          Components: R
            Reporter: Neal Richardson


{code:r}
test_that("Factors are preserved when writing/reading from Parquet", {
  tf <- tempfile()
  on.exit(unlink(tf))
  df <- data.frame(a = factor(c("a", "b")))
  write_parquet(df, tf)
  expect_equivalent(read_parquet(tf), df)
})
{code}

Fails:
{code}
`object` not equivalent to `expected`.
Component “a”: target is character, current is factor
{code}

This has to do with the translation with Parquet and not the R <--> Arrow type mapping (unlike ARROW-7028). If you write_feather and read_feather, the test passes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)