nealrichardson commented on a change in pull request #9800: URL: https://github.com/apache/arrow/pull/9800#discussion_r601572867
########## File path: r/R/dataset-factory.R ########## @@ -45,15 +45,18 @@ DatasetFactory$create <- function(x, return(dataset___UnionDatasetFactory__Make(x)) } - path_and_fs <- get_path_and_filesystem(x, filesystem) - selector <- FileSelector$create(path_and_fs$path, allow_not_found = FALSE, recursive = TRUE) - if (is.character(format)) { format <- FileFormat$create(match.arg(format), ...) } else { assert_is(format, "FileFormat") } + path_and_fs <- get_path_and_filesystem(x, filesystem) + + if (length(path_and_fs$path) > 1) { Review comment: We also want to support the length-1 (a single file) use case. So if we have a length-1 path, we need to check if it is a file or directory. At this point, `path_and_fs$fs` is guaranteed to be a FileSystem -> FileSystem has a GetFileInfo method -> FileInfo has a `type` active binding -> see enums.R for what FileTypes are. -- 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: us...@infra.apache.org