tustvold commented on code in PR #3083:
URL: https://github.com/apache/arrow-datafusion/pull/3083#discussion_r940626261
##########
datafusion/core/src/datasource/file_format/json.rs:
##########
@@ -231,17 +231,21 @@ mod tests {
projection: Option<Vec<usize>>,
limit: Option<usize>,
) -> Result<Arc<dyn ExecutionPlan>> {
+ let store_root = env!("CARGO_MANIFEST_DIR");
let filename = "tests/jsons/2.json";
let format = JsonFormat::default();
- scan_format(&format, ".", filename, projection, limit).await
+ scan_format(&format, store_root, filename, projection, limit).await
}
#[tokio::test]
async fn infer_schema_with_limit() {
let store = Arc::new(LocalFileSystem::new()) as _;
- let filename = "tests/jsons/schema_infer_limit.json";
let format = JsonFormat::default().with_schema_infer_max_rec(Some(3));
+ let store_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
+ let filename = store_root.join("tests/jsons/schema_infer_limit.json");
+ let filename = filename.to_str().expect("Unable to get path!");
Review Comment:
No worries at all, for reference the reason this breaks is that paths on
Windows not only don't start with `/` but when canonicalized get converted to
[extended length path
syntax](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file).
Its a complete nonsensical mess, in the end I punted on all this and
LocalFileSystem actually just implements the file URI standard which basically
behaves like paths on Linux (or paths on anything that isn't Windows :laughing:
)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]