devinjdangelo commented on code in PR #9240:
URL: https://github.com/apache/arrow-datafusion/pull/9240#discussion_r1493057195
##########
datafusion/common/src/file_options/mod.rs:
##########
@@ -97,6 +97,20 @@ impl StatementOptions {
maybe_option.map(|(_, v)| v)
}
+ /// Finds partition_by option if exists and parses into a `Vec<String>`.
+ /// If option doesn't exist, returns empty `vec![]`.
+ /// E.g. (partition_by 'colA, colB, colC') -> `vec!['colA','colB','colC']`
+ pub fn take_partition_by(&mut self) -> Vec<String> {
+ let partition_by = self.take_str_option("partition_by");
+ match partition_by {
+ Some(part_cols) => part_cols
+ .split(',')
+ .map(|s| s.trim().replace('\'', ""))
Review Comment:
I was able to get COPY + partition_by to work with single quote containing
column names, but the read path doesn't seem to work and I even managed to
trigger a panic. I wonder if we should track down that bug to support ' in the
name of a partition column or if we should just declare that unsupported and
reject partition by ("'column_name'")
--
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]