LucaCappelletti94 commented on code in PR #2077:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2077#discussion_r2527909660


##########
src/ast/mod.rs:
##########
@@ -4579,19 +4574,97 @@ impl fmt::Display for Statement {
                 if !legacy_options.is_empty() {
                     write!(f, " {}", display_separated(legacy_options, " "))?;
                 }
+
+                let mut null_symbol = "\\N";
+                let mut delimiter = '\t';
+                let mut quote = '"';
+                let mut escape = '\\';
+
+                // Apply options
+                for option in options {
+                    match option {
+                        CopyOption::Delimiter(c) => {
+                            delimiter = *c;
+                        }
+                        CopyOption::Quote(c) => {
+                            quote = *c;
+                        }
+                        CopyOption::Escape(c) => {
+                            escape = *c;
+                        }
+                        CopyOption::Null(null) => {
+                            null_symbol = null;
+                        }
+                        _ => {}
+                    }
+                }
+
+                // Apply legacy options
+                for option in legacy_options {
+                    match option {
+                        CopyLegacyOption::Delimiter(c) => {
+                            delimiter = *c;
+                        }
+                        CopyLegacyOption::Null(null) => {
+                            null_symbol = null;
+                        }
+                        CopyLegacyOption::Csv(csv_options) => {
+                            for csv_option in csv_options {
+                                match csv_option {
+                                    CopyLegacyCsvOption::Quote(c) => {
+                                        quote = *c;
+                                    }
+                                    CopyLegacyCsvOption::Escape(c) => {
+                                        escape = *c;
+                                    }
+                                    _ => {}
+                                }
+                            }
+                        }
+                        _ => {}

Review Comment:
   Done



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to