-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Make default ListingFilesCache table scoped #19616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -63,7 +63,8 @@ impl TableProviderFactory for ListingTableFactory { | |||||||||||||
| ))? | ||||||||||||||
| .create(session_state, &cmd.options)?; | ||||||||||||||
|
|
||||||||||||||
| let mut table_path = ListingTableUrl::parse(&cmd.location)?; | ||||||||||||||
| let mut table_path = | ||||||||||||||
| ListingTableUrl::parse(&cmd.location)?.with_table_ref(cmd.name.clone()); | ||||||||||||||
| let file_extension = match table_path.is_collection() { | ||||||||||||||
| // Setting the extension to be empty instead of allowing the default extension seems | ||||||||||||||
| // odd, but was done to ensure existing behavior isn't modified. It seems like this | ||||||||||||||
|
|
@@ -160,7 +161,9 @@ impl TableProviderFactory for ListingTableFactory { | |||||||||||||
| } | ||||||||||||||
| None => format!("*.{}", cmd.file_type.to_lowercase()), | ||||||||||||||
| }; | ||||||||||||||
| table_path = table_path.with_glob(glob.as_ref())?; | ||||||||||||||
| table_path = table_path | ||||||||||||||
| .with_glob(glob.as_ref())? | ||||||||||||||
| .with_table_ref(cmd.name.clone()); | ||||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
datafusion/datafusion/datasource/src/url.rs Lines 321 to 326 in 1f654bb
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we could make table_path maintain with_glob. I did this change in And it seems to have worked well
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you so much! I think I can merge the change, or would you like that in a separate PR? |
||||||||||||||
| } | ||||||||||||||
| let schema = options.infer_schema(session_state, &table_path).await?; | ||||||||||||||
| let df_schema = Arc::clone(&schema).to_dfschema()?; | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️