panbingkun commented on code in PR #47460: URL: https://github.com/apache/spark/pull/47460#discussion_r1689248604
########## docs/sql-ref-syntax-ddl-declare-variable.md: ########## @@ -72,6 +72,17 @@ DECLARE [ OR REPLACE ] [ VARIABLE ] -- The dense form of declaring a variable with default DECLARE five = 5; +-- Declare a defined variable +DECLARE five = 55; +[VARIABLE_ALREADY_EXISTS] Cannot create the variable `system`.`session`.`five` because it already exists. +Choose a different name, or drop or replace the existing variable. SQLSTATE: 42723 + +-- Use `DECLARE OR REPLACE` to declare a defined variable +DECLARE OR REPLACE five = 55; Review Comment: Yes, this doc mentions it in the `Syntax` section, but `don't` show it in the example. <img width="377" alt="image" src="https://github.com/user-attachments/assets/f89ee3f0-bc62-49a2-8ac6-74490bd49a81"> -- 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]
