tinfoil-knight commented on code in PR #9594:
URL: https://github.com/apache/arrow-datafusion/pull/9594#discussion_r1523723195
##########
datafusion/sql/src/statement.rs:
##########
@@ -855,6 +855,26 @@ 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);
+ match &file_type {
+ // Renames un-prefixed keys to support legacy format specific
options
+ FileType::CSV | FileType::JSON | FileType::PARQUET => {
+ let prefix = format!("{}", file_type);
+ let keys_to_rename: Vec<_> = options
+ .keys()
+ .filter(|key| !key.starts_with(&prefix))
+ .cloned()
+ .collect();
+
+ for key in keys_to_rename {
+ if let Some(value) = options.remove(&key) {
+ let new_key = format!("{}.{}", prefix, key);
+ options.insert(new_key, value);
+ }
+ }
+ }
+ _ => {}
+ }
+
Review Comment:
Implemented both changes.
Converted the PR to draft for the while being due to
https://github.com/apache/arrow-datafusion/pull/9594#issuecomment-1995225783.
--
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]