You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "dilovancelik (via GitHub)" <gi...@apache.org> on 2025/04/01 18:49:22 UTC
[PR] added functionality to handle output statement [datafusion-sqlparser-rs]
dilovancelik opened a new pull request, #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790
Hey I have added a feature to handle OUTPUT Statements in the end of merge statements, which is used in MS SQL per the following issue [1789](https://github.com/apache/datafusion-sqlparser-rs/issues/1789) that I created.
- I've added the OUTPUT Keyword
- I've added a struct in for Output in ast/mod.rs
- I've added an optional Output parameter to the Merge struct in ast/mod.rs
- added function for parsing the output parameter in parser/mod.rs
- updated parse merge clause function, to break on output keyword
- updated parse merge to handling of the output clause
- added and updated tests
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio merged PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2781035649
Awesome thanks again @dilovancelik!
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2025428782
##########
src/parser/mod.rs:
##########
@@ -14586,6 +14589,29 @@ impl<'a> Parser<'a> {
Ok(clauses)
}
+ pub fn parse_output(&mut self) -> Result<Output, ParserError> {
+ self.expect_keyword_is(Keyword::OUTPUT)?;
+ let select_items = self.parse_projection()?;
+ self.expect_keyword_is(Keyword::INTO)?;
+ let temporary = self
+ .parse_one_of_keywords(&[Keyword::TEMP, Keyword::TEMPORARY])
+ .is_some();
+ let unlogged = self.parse_keyword(Keyword::UNLOGGED);
+ let table = self.parse_keyword(Keyword::TABLE);
+ let name = self.parse_object_name(false)?;
+ let into_table = SelectInto {
+ temporary,
+ unlogged,
+ table,
+ name,
+ };
Review Comment:
Yeah that makes sense. I made it, it's own function, which I called parse_select_into, since it returns the SelectInto structure, that way its consistent
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2026318468
##########
src/parser/mod.rs:
##########
@@ -14586,6 +14585,34 @@ impl<'a> Parser<'a> {
Ok(clauses)
}
+ fn parse_output(&mut self) -> Result<OutputClause, ParserError> {
+ self.expect_keyword_is(Keyword::OUTPUT)?;
+ let select_items = self.parse_projection()?;
+ self.expect_keyword_is(Keyword::INTO)?;
+ let into_table = self.parse_select_into()?;
+
+ Ok(OutputClause {
+ select_items,
+ into_table,
+ })
+ }
+
+ fn parse_select_into(&mut self) -> Result<SelectInto, ParserError> {
Review Comment:
good idea, I've changed it to use the new function!
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2780786183
No worries, I just couldn't get the error locally so couldn't fix. That however was because my main was one commit behind. I synced and removed the borrow which threw the error.
Again thanks for all the feedback, this has been a really pleasant first OS experience
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2025413049
##########
src/parser/mod.rs:
##########
@@ -14489,7 +14489,10 @@ impl<'a> Parser<'a> {
pub fn parse_merge_clauses(&mut self) -> Result<Vec<MergeClause>, ParserError> {
let mut clauses = vec![];
loop {
- if self.peek_token() == Token::EOF || self.peek_token() == Token::SemiColon {
+ if self.peek_token() == Token::EOF
+ || self.peek_token() == Token::SemiColon
+ || self.peek_keyword(Keyword::OUTPUT)
Review Comment:
I definitely see your point. I implemented and had to remove the expect_keyword_is below since the keyword is consumed in the check
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2773468790
> Thanks @dilovancelik! The changes look reasonable to me overall, left some comments
@iffyio thanks a lot for the comments, I just applied your suggestions. For the other comments, I believe they make a lot of sense, and have implemented what you suggested. I have not resolved those conversations, since I don't know if you would like to do it your self after checking my new commits :)
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2780725201
I don't understudy why run clippy fails, It does. not do it on my machine, and it also seems to be we code which is not part of my PR. Is there anything I can do to help out with it?
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2780303913
Hey I did a rebase, and I think something went wrong, now I just did a classic merge, and et looks like the extra commits are gone. Sorry.
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2025383121
##########
src/ast/mod.rs:
##########
@@ -7900,6 +7909,36 @@ impl Display for MergeClause {
}
}
+/// A Output in the end of a 'MERGE' Statement
+///
+/// Example:
+/// OUTPUT $action, deleted.* INTO dbo.temp_products;
+/// [mssql](https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql)
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
+pub struct Output {
Review Comment:
agreed
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2025384167
##########
src/ast/mod.rs:
##########
@@ -5407,14 +5410,20 @@ impl fmt::Display for Statement {
source,
on,
clauses,
+ output,
} => {
write!(
f,
"MERGE{int} {table} USING {source} ",
int = if *into { " INTO" } else { "" }
)?;
write!(f, "ON {on} ")?;
- write!(f, "{}", display_separated(clauses, " "))
+ write!(f, "{}", display_separated(clauses, " "))?;
+ if output.is_some() {
+ let out = output.clone().unwrap();
+ write!(f, " {out}")?;
+ }
Review Comment:
Yeah, that makes a lot of sense, it also looks a lot cleaner
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2780738089
Oh yes so that failure is my bad and came from the last PR that landed on main yesterday, it fails on rust 1.86. To be clear its not related to this PR but its possible to resolve, @dilovancelik would you be able to resolve the lint failure in this PR and I can merge both in the same go? Sorry for the hassle
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2026230661
##########
src/parser/mod.rs:
##########
@@ -14586,6 +14585,34 @@ impl<'a> Parser<'a> {
Ok(clauses)
}
+ fn parse_output(&mut self) -> Result<OutputClause, ParserError> {
+ self.expect_keyword_is(Keyword::OUTPUT)?;
+ let select_items = self.parse_projection()?;
+ self.expect_keyword_is(Keyword::INTO)?;
+ let into_table = self.parse_select_into()?;
+
+ Ok(OutputClause {
+ select_items,
+ into_table,
+ })
+ }
+
+ fn parse_select_into(&mut self) -> Result<SelectInto, ParserError> {
Review Comment:
oh could we also update [this usage](https://github.com/apache/datafusion-sqlparser-rs/blob/01c7db690c01a84a5cf5d29445d3149889dbd02a/src/parser/mod.rs#L10913-L10924) to call this `parse_select_into()` function as well?
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2774659454
I updated the old usage to use the new parse_select_into function and ran all tests :)
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2779416824
@dilovancelik when you get the chance to could you merge in latest from main, in order to fix the CI issue?
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2025411856
##########
tests/sqlparser_mssql.rs:
##########
@@ -1921,3 +1921,9 @@ fn ms() -> TestedDialects {
fn ms_and_generic() -> TestedDialects {
TestedDialects::new(vec![Box::new(MsSqlDialect {}), Box::new(GenericDialect {})])
}
+
+#[test]
+fn parse_mssql_merge_with_output() {
+ let stmt = "MERGE dso.products AS t USING dsi.products AS s ON s.ProductID = t.ProductID WHEN MATCHED AND NOT (t.ProductName = s.ProductName OR (ISNULL(t.ProductName, s.ProductName) IS NULL)) THEN UPDATE SET t.ProductName = s.ProductName WHEN NOT MATCHED BY TARGET THEN INSERT (ProductID, ProductName) VALUES (s.ProductID, s.ProductName) WHEN NOT MATCHED BY SOURCE THEN DELETE OUTPUT $action, deleted.ProductID INTO dsi.temp_products";
Review Comment:
Yeah that makes a lot of sense. Its should be updated to be multiline now
--
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] added functionality to handle MSSQL output statement [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#discussion_r2025317055
##########
src/ast/mod.rs:
##########
@@ -7900,6 +7909,36 @@ impl Display for MergeClause {
}
}
+/// A Output in the end of a 'MERGE' Statement
+///
+/// Example:
+/// OUTPUT $action, deleted.* INTO dbo.temp_products;
+/// [mssql](https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql)
+
Review Comment:
```suggestion
```
##########
tests/sqlparser_mssql.rs:
##########
@@ -1921,3 +1921,9 @@ fn ms() -> TestedDialects {
fn ms_and_generic() -> TestedDialects {
TestedDialects::new(vec![Box::new(MsSqlDialect {}), Box::new(GenericDialect {})])
}
+
+#[test]
+fn parse_mssql_merge_with_output() {
+ let stmt = "MERGE dso.products AS t USING dsi.products AS s ON s.ProductID = t.ProductID WHEN MATCHED AND NOT (t.ProductName = s.ProductName OR (ISNULL(t.ProductName, s.ProductName) IS NULL)) THEN UPDATE SET t.ProductName = s.ProductName WHEN NOT MATCHED BY TARGET THEN INSERT (ProductID, ProductName) VALUES (s.ProductID, s.ProductName) WHEN NOT MATCHED BY SOURCE THEN DELETE OUTPUT $action, deleted.ProductID INTO dsi.temp_products";
Review Comment:
to help with readability could we use line breaks for formatting here similar to the `test_merge_with_output` test case in?
##########
src/ast/mod.rs:
##########
@@ -5407,14 +5410,20 @@ impl fmt::Display for Statement {
source,
on,
clauses,
+ output,
} => {
write!(
f,
"MERGE{int} {table} USING {source} ",
int = if *into { " INTO" } else { "" }
)?;
write!(f, "ON {on} ")?;
- write!(f, "{}", display_separated(clauses, " "))
+ write!(f, "{}", display_separated(clauses, " "))?;
+ if output.is_some() {
+ let out = output.clone().unwrap();
+ write!(f, " {out}")?;
+ }
Review Comment:
```suggestion
if let Some(output) = output {
write!(f, " {output}")?;
}
```
we could rewrite it to use existing convention in order to replace the unwrap
##########
src/parser/mod.rs:
##########
@@ -14586,6 +14589,29 @@ impl<'a> Parser<'a> {
Ok(clauses)
}
+ pub fn parse_output(&mut self) -> Result<Output, ParserError> {
+ self.expect_keyword_is(Keyword::OUTPUT)?;
+ let select_items = self.parse_projection()?;
+ self.expect_keyword_is(Keyword::INTO)?;
+ let temporary = self
+ .parse_one_of_keywords(&[Keyword::TEMP, Keyword::TEMPORARY])
+ .is_some();
+ let unlogged = self.parse_keyword(Keyword::UNLOGGED);
+ let table = self.parse_keyword(Keyword::TABLE);
+ let name = self.parse_object_name(false)?;
+ let into_table = SelectInto {
+ temporary,
+ unlogged,
+ table,
+ name,
+ };
Review Comment:
This looks to be the same code as in `parse_select`? could we factor that into a function like `parse_into_clause()` that could be reused in both places?
##########
src/parser/mod.rs:
##########
@@ -14586,6 +14589,29 @@ impl<'a> Parser<'a> {
Ok(clauses)
}
+ pub fn parse_output(&mut self) -> Result<Output, ParserError> {
Review Comment:
```suggestion
fn parse_output(&mut self) -> Result<Output, ParserError> {
```
##########
src/parser/mod.rs:
##########
@@ -14489,7 +14489,10 @@ impl<'a> Parser<'a> {
pub fn parse_merge_clauses(&mut self) -> Result<Vec<MergeClause>, ParserError> {
let mut clauses = vec![];
loop {
- if self.peek_token() == Token::EOF || self.peek_token() == Token::SemiColon {
+ if self.peek_token() == Token::EOF
+ || self.peek_token() == Token::SemiColon
+ || self.peek_keyword(Keyword::OUTPUT)
Review Comment:
hmm I wonder in order to avoid accumulating conditions here over time, would it make sense to change to something like this? replacing the EOF, Semicolon and OUTPUT conditions
```rust
loop {
if !self.parse_keyword(Keyword::WHEN) {
break
}
// ...
}
```
##########
src/ast/mod.rs:
##########
@@ -3828,6 +3829,8 @@ pub enum Statement {
on: Box<Expr>,
/// Specifies the actions to perform when values match or do not match.
clauses: Vec<MergeClause>,
+ // Speccifies the output to save changes in MSSQL
Review Comment:
```suggestion
// Specifies the output to save changes in MSSQL
```
##########
src/ast/mod.rs:
##########
@@ -7900,6 +7909,36 @@ impl Display for MergeClause {
}
}
+/// A Output in the end of a 'MERGE' Statement
+///
+/// Example:
+/// OUTPUT $action, deleted.* INTO dbo.temp_products;
+/// [mssql](https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql)
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
+#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
+#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]
+pub struct Output {
Review Comment:
```suggestion
pub struct OutputClause {
```
thinking maybe calling it `OutputClause` per their docs would be better? since `Output` would be a bit too generic out without context
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2779657352
@dilovancelik Oh could you take a look at the added commits, not sure how the merge from main was done but there's some extraneous diffs that's been brought into the PR
--
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] MSSQL: Add support for functionality `MERGE` output clause [datafusion-sqlparser-rs]
Posted by "dilovancelik (via GitHub)" <gi...@apache.org>.
dilovancelik commented on PR #1790:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1790#issuecomment-2779444677
should be added now :)
--
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