You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/26 15:04:19 UTC

[GitHub] [spark] MaxGekk opened a new pull request, #36688: [SPARK-39305][SQL] Add the `EQUAL_NULL` alias of `<=>`

MaxGekk opened a new pull request, #36688:
URL: https://github.com/apache/spark/pull/36688

   ### What changes were proposed in this pull request?
   In the PR, I propose to add new alias `EQUAL_NULL` for the `EqualNullSafe` expression and the `<=>` operator. New function returns:
   - EQUAL_NULL( NULL , NULL ) -> TRUE
   - EQUAL_NULL( NULL , `<not_null>` ) -> FALSE
   - EQUAL_NULL( `<not_null>` , NULL ) -> FALSE
   
   Otherwise EQUAL_NULL(`<expr1>`, `<expr2>`) is equivalent to `<expr1>` = `<expr2>`.
   
   ### Why are the changes needed?
   To make the migration process from other systems to Spark SQL easier, and achieve feature parity to such systems. For example, Snowflake supports the `EQUAL_NULL` function, see https://docs.snowflake.com/en/sql-reference/functions/equal_null.html.
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   By running new tests:
   ```
   $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z null-handling.sql"
   ```


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #36688: [SPARK-39305][SQL] Add the `EQUAL_NULL` alias of `<=>`

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #36688:
URL: https://github.com/apache/spark/pull/36688#discussion_r882815330


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -744,6 +744,7 @@ object FunctionRegistry {
 
     // comparison operators
     expression[EqualNullSafe]("<=>"),
+    expression[EqualNullSafe]("equal_null", true, Some("3.4.0")),

Review Comment:
   We probably need to use `RuntimeReplaceable` for a better func doc. Currently, the func doc is like
   `expr1 equal_null expr2 - Returns same result ...` which is quite weird.



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on a diff in pull request #36688: [SPARK-39305][SQL] Add the `EQUAL_NULL()` function

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #36688:
URL: https://github.com/apache/spark/pull/36688#discussion_r883005170


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -744,6 +744,7 @@ object FunctionRegistry {
 
     // comparison operators
     expression[EqualNullSafe]("<=>"),
+    expression[EqualNullSafe]("equal_null", true, Some("3.4.0")),

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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk closed pull request #36688: [SPARK-39305][SQL] Add the `EQUAL_NULL()` function

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #36688: [SPARK-39305][SQL] Add the `EQUAL_NULL()` function
URL: https://github.com/apache/spark/pull/36688


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] MaxGekk commented on pull request #36688: [SPARK-39305][SQL] Add the `EQUAL_NULL()` function

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #36688:
URL: https://github.com/apache/spark/pull/36688#issuecomment-1139293245

   Merging to master. Thank you, @cloud-fan for review.


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org