maropu commented on a change in pull request #28139: [SPARK-31362][SQL][DOCS] Document Set Operators in SQL Reference URL: https://github.com/apache/spark/pull/28139#discussion_r404525315
########## File path: docs/sql-ref-syntax-qry-select-setops.md ########## @@ -19,4 +19,125 @@ license: | limitations under the License. --- -**This page is under construction** +Set operators are used to combine two input relations into a single one. Spark SQL supports three types of set operators: +- `EXCEPT` and `EXCEPT ALL` +- `INTERSECT` and `INTERSECT ALL` +- `UNION` and `UNION ALL` + +Note that input relations must have the same number of columns and compatible data types for the respective columns. + +### EXCEPT and EXCEPT ALL +`EXCEPT` and `EXCEPT ALL` return the rows that are found in one relation but not the other. `EXCEPT` takes only distinct rows while `EXCEPT ALL` does not remove duplicates. Review comment: `does not remove duplicates.` -> `does not remove duplicates from the result rows.`? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
