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

[R] Add better error message for if a non-schema passed into open_dataset()

Details

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

    Description

      The issue here comes from accidentally passing in the schema function instead of the created schema object, but the error message isn't helpful

      
      library(dplyr)
      desired_schema <- schema(mpg = float64(), disp = float64(), hp = int64(), drat = float64(), 
          wt = float64(), qsec = float64(), vs = int64(), am = int64(), 
          gear = int64(), carb = int64(), cyl = int64())
      
      tf <- tempfile()
      dir.create(tf)
      write_dataset(group_by(mtcars, cyl), tf, format = "csv", hive_style = FALSE)
      open_dataset(tf, format = "csv", schema = schema) %>% collect()
      #> Error in `CsvFileFormat$create()`:
      #> ! Values in `column_names` must match `schema` field names
      #> ✖ `column_names` and `schema` field names match but are not in the same order
      
      
      

      Attachments

        Issue Links

          Activity

            People

              thisisnic Nicola Crane
              thisisnic Nicola Crane
              Votes:
              0 Vote for this issue
              Watchers:
              2 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

                  Slack

                    Issue deployment