Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-16154: [R] Errors which pass through
handle_csv_read_error()
…
…and `handle_parquet_io_error()` need better error tracing As discussed on #12826 Not sure how (if) to write tests but tried running it locally using the CSV directory set up in `test-dataset-csv.R` with and without this change, and without it, we get, e.g. ``` open_dataset(csv_dir) # Error in `handle_parquet_io_error()` at r/R/dataset.R:221:6: # ! Invalid: Error creating dataset. Could not read schema from '/tmp/RtmpuTyOD8/file5049dcf581a5/5/file1.csv': Could not open Parquet input source '/tmp/RtmpuTyOD8/file5049dcf581a5/5/file1.csv': Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file. # /home/nic2/arrow/cpp/src/arrow/dataset/file_parquet.cc:323 GetReader(source, scan_options). Is this a 'parquet' file? # /home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:40 InspectSchemas(std::move(options)) # /home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:262 Inspect(options.inspect_options) # ℹ Did you mean to specify a 'format' other than the default (parquet)? ``` and then with it: ``` open_dataset(csv_dir) # Error in `open_dataset()`: # ! Invalid: Error creating dataset. Could not read schema from '/tmp/RtmpLbqZs6/file4e4ca14fb5795/5/file1.csv': Could not open Parquet input source '/tmp/RtmpLbqZs6/file4e4ca14fb5795/5/file1.csv': Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file. # /home/nic2/arrow/cpp/src/arrow/dataset/file_parquet.cc:323 GetReader(source, scan_options). Is this a 'parquet' file? # /home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:40 InspectSchemas(std::move(options)) # /home/nic2/arrow/cpp/src/arrow/dataset/discovery.cc:262 Inspect(options.inspect_options) # ℹ Did you mean to specify a 'format' other than the default (parquet)? ``` Closes #12839 from thisisnic/ARROW-16154_error_trace Authored-by: Nic Crane <[email protected]> Signed-off-by: Nic Crane <[email protected]>
- Loading branch information