tinfoil-knight commented on code in PR #9723:
URL: https://github.com/apache/arrow-datafusion/pull/9723#discussion_r1534086659
##########
datafusion/sql/src/statement.rs:
##########
@@ -850,7 +850,16 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
return plan_err!("Unsupported Value in COPY statement {}",
value);
}
};
- options.insert(key.to_lowercase(), value_string.to_lowercase());
+ if !(&key.contains(".")) {
+ // If config does not belong to any namespace, assume it is
+ // a format option and apply the format prefix for backwards
+ // compatibility.
+
+ let renamed_key = format!("format.{}", key);
+ options.insert(renamed_key.to_lowercase(),
value_string.to_lowercase());
+ } else {
+ options.insert(key.to_lowercase(),
value_string.to_lowercase());
+ }
}
Review Comment:
Note for @devinjdangelo
In the previous similar PR, we were only renaming keys when the file type
matches JSON, CSV or PARQUET.
See
https://github.com/apache/arrow-datafusion/pull/9594/files#diff-bb98aeaec478d9576e33911f252745961f57e38d25f6e9d13803894dfbad25d5R876-R881
I decided to not do this now since it'd seem weird if some file types need a
`format` prefix & others don't.
Let me know if you think differently.
---
Sidenote: Other file formats don't have any supported format options
currently.
--
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]