alamb commented on code in PR #7291:
URL: https://github.com/apache/arrow-datafusion/pull/7291#discussion_r1296250896


##########
datafusion/sql/src/parser.rs:
##########
@@ -74,7 +103,7 @@ pub struct CopyToStatement {
     /// The URL to where the data is heading
     pub target: String,
     /// Target specific options
-    pub options: HashMap<String, Value>,
+    pub options: Vec<(String, Value)>,

Review Comment:
   I also changed the parser to preserve the order of the options so the output 
is consistent (rather than whatever order the hashmap decided). Without that 
the CI failed because the output order was different on windows than it was on 
Linux -- see[ this 
example](https://github.com/apache/arrow-datafusion/actions/runs/5881681823/job/15950679990?pr=7291)



##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -1100,15 +1100,13 @@ impl LogicalPlan {
                         options,
                     }) => {
                         let mut op_str = String::new();
-                        op_str.push('(');
                         for (key, val) in options {
                             if !op_str.is_empty() {
-                                op_str.push(',');
+                                op_str.push_str(", ");
                             }
                             op_str.push_str(&format!("{key} {val}"));
                         }
-                        op_str.push(')');
-                        write!(f, "CopyTo: format={file_format} 
output_url={output_url} per_thread_output={per_thread_output} options: 
{op_str}")
+                        write!(f, "CopyTo: format={file_format} 
output_url={output_url} per_thread_output={per_thread_output} options: 
({op_str})")

Review Comment:
   this fixed a bug where the output was wacky:
   
   ```
   CopyTo: format=parquet output_url=test_files/scratch/table 
per_thread_output=true options: (,format parquet,per_thread_output true)
   ```



-- 
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]

Reply via email to