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

[R] Factor type not preserved in Parquet roundtrip

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.16.0
    • Component/s: 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

              • Assignee:
                yutannihilation Hiroaki Yutani
                Reporter:
                npr Neal Richardson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 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