Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-7045

[R] Factor type not preserved in Parquet roundtrip

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.16.0
    • R

    Description

      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)
      })
      

      Fails:

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

      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.

      Attachments

        Issue Links

          Activity

            People

              yutannihilation Hiroaki Yutani
              npr Neal Richardson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m