devinjdangelo commented on code in PR #9594:
URL: https://github.com/apache/arrow-datafusion/pull/9594#discussion_r1524728358
##########
datafusion/sql/src/statement.rs:
##########
@@ -855,6 +855,31 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
let file_type = try_infer_file_type(&mut options, &statement.target)?;
let partition_by = take_partition_by(&mut options);
+ let rename_keys = |options: HashMap<String, String>| {
+ options
+ .into_iter()
+ .map(|(k, v)| {
+ // If config does not belong to any namespace, assume it is
+ // a legacy option and apply file_type namespace for
backwards
+ // compatibility.
+ if !k.contains('.') {
+ let new_key = format!("{}.{}", file_type, k);
+ (new_key, v)
+ } else {
+ (k, v)
+ }
+ })
+ .collect()
+ };
+
+ // Renames un-prefixed keys to support legacy format specific options
+ let options = match &file_type {
+ FileType::CSV | FileType::JSON => rename_keys(options),
+ #[cfg(feature = "parquet")]
+ FileType::PARQUET => rename_keys(options),
Review Comment:
@tinfoil-knight I did not observe this when I pulled down the latest changes
locally. In my experience, rust-analyzer is amazing but can also be flaky with
large/complex workspaces like datafusion. I occasionally need to do a "hard
reset" to get rid of strange errors or warnings like this which I do not
believe are correct (i.e. cargo check disagrees with rust-analyzer).
1. Close and reopen VS code
2. If 1 doesn't work, cargo clean and then close/reopen VS code
When working with non default features, it can be helpful to force rust
analyzer to enable all features. You can add this to your settings.json for
VScode:
```
"rust-analyzer.cargo.features": [
"all"
]
```
--
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]