datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

[WIP] Make ListingTableUrl allow direct construction

Open OussamaSaoudi opened this issue 1 year ago • 0 comments

Which issue does this PR close?

Closes #12581

Rationale for this change

What changes are included in this PR?

This PR allows users to construct ListingTableUrl directly with a Path instead of getting the path by parsing the Url path. This is useful when the user already has an object_store::path::Path, and doesn't want to convert their path to string only for it to be parsed again in try_new.

This PR also changes the impl<P> for DataFilePaths where P: AsRef<str>. Previously, passing a Vec<ListingTableUrl> to read_parquet would convert the ListingTableUrl to &str and parse it back to Vec<ListingTableUrl>. This causes issues with escape characters. Instead, I split the trait impl into cases for Vec<&str> and Vec<ListingTableUrl>.

Are these changes tested?

I add one test to make sure that passing Vec<ListingTableUrl> works as expected, and does not cause errors due to escape characters.

Are there any user-facing changes?

OussamaSaoudi avatar Oct 17 '24 06:10 OussamaSaoudi