jonkeane commented on a change in pull request #10326:
URL: https://github.com/apache/arrow/pull/10326#discussion_r634591911
##########
File path: r/R/dataset.R
##########
@@ -93,8 +93,19 @@ open_dataset <- function(sources,
return(dataset___UnionDataset__create(sources, schema))
}
factory <- DatasetFactory$create(sources, partitioning = partitioning, ...)
- # Default is _not_ to inspect/unify schemas
- factory$Finish(schema, isTRUE(unify_schemas))
+
+ tryCatch(
+ # Default is _not_ to inspect/unify schemas
+ factory$Finish(schema, isTRUE(unify_schemas)),
+ error = function (e) {
+ msg <- conditionMessage(e)
+ if(grep("Parquet magic bytes not found in footer", msg)){
+ stop("Looks like these are not parquet files, did you mean to specify
a 'format'?", call. = FALSE)
Review comment:
Oh, I think that's totally fine to have a message like this after that.
The helpfulness might be a bit of a distraction, but I think most people who
get this error message will either be in need of the helpfulness or be
knowledgeable enough about their underlying data to not get too distracted by
it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]