You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "yoavcloud (via GitHub)" <gi...@apache.org> on 2025/08/20 13:01:29 UTC

[PR] Redshift: Add more copy options [datafusion-sqlparser-rs]

yoavcloud opened a new pull request, #2008:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2008

   (no comment)


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Redshift: Add more copy options [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio merged PR #2008:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2008


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Redshift: Add more copy options [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #2008:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2008#discussion_r2291362876


##########
src/parser/mod.rs:
##########
@@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> {
                 }
                 opts
             }),
+            Some(Keyword::DATEFORMAT) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]

Review Comment:
   ```suggestion
                   let _ = self.parse_keyword(Keyword::AS);
   ```



##########
src/parser/mod.rs:
##########
@@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> {
                 }
                 opts
             }),
+            Some(Keyword::DATEFORMAT) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]
+                let fmt = if matches!(self.peek_token().token, Token::SingleQuotedString(_)) {
+                    Some(self.parse_literal_string()?)
+                } else {
+                    None
+                };
+                CopyLegacyOption::DateFormat(fmt)
+            }
+            Some(Keyword::DELIMITER) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]
+                CopyLegacyOption::Delimiter(self.parse_literal_char()?)
+            }
+            Some(Keyword::EMPTYASNULL) => CopyLegacyOption::EmptyAsNull,
             Some(Keyword::IAM_ROLE) => CopyLegacyOption::IamRole(self.parse_iam_role_kind()?),
             Some(Keyword::IGNOREHEADER) => {
                 let _ = self.parse_keyword(Keyword::AS);
                 let num_rows = self.parse_literal_uint()?;
                 CopyLegacyOption::IgnoreHeader(num_rows)
             }
+            Some(Keyword::NULL) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]

Review Comment:
   ```suggestion
                   let _ = self.parse_keyword(Keyword::AS);
   ```



##########
src/parser/mod.rs:
##########
@@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> {
                 }
                 opts
             }),
+            Some(Keyword::DATEFORMAT) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]
+                let fmt = if matches!(self.peek_token().token, Token::SingleQuotedString(_)) {
+                    Some(self.parse_literal_string()?)
+                } else {
+                    None
+                };
+                CopyLegacyOption::DateFormat(fmt)
+            }
+            Some(Keyword::DELIMITER) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]

Review Comment:
   ```suggestion
                   let _ = self.parse_keyword(Keyword::AS);
   ```



##########
src/parser/mod.rs:
##########
@@ -9569,12 +9584,40 @@ impl<'a> Parser<'a> {
                 }
                 opts
             }),
+            Some(Keyword::DATEFORMAT) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]
+                let fmt = if matches!(self.peek_token().token, Token::SingleQuotedString(_)) {
+                    Some(self.parse_literal_string()?)
+                } else {
+                    None
+                };
+                CopyLegacyOption::DateFormat(fmt)
+            }
+            Some(Keyword::DELIMITER) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]
+                CopyLegacyOption::Delimiter(self.parse_literal_char()?)
+            }
+            Some(Keyword::EMPTYASNULL) => CopyLegacyOption::EmptyAsNull,
             Some(Keyword::IAM_ROLE) => CopyLegacyOption::IamRole(self.parse_iam_role_kind()?),
             Some(Keyword::IGNOREHEADER) => {
                 let _ = self.parse_keyword(Keyword::AS);
                 let num_rows = self.parse_literal_uint()?;
                 CopyLegacyOption::IgnoreHeader(num_rows)
             }
+            Some(Keyword::NULL) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]
+                CopyLegacyOption::Null(self.parse_literal_string()?)
+            }
+            Some(Keyword::TIMEFORMAT) => {
+                let _ = self.parse_keyword(Keyword::AS); // [ AS ]

Review Comment:
   ```suggestion
                   let _ = self.parse_keyword(Keyword::AS);
   ```



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org