You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2020/10/27 23:42:07 UTC

[spark] branch branch-3.0 updated: [SPARK-33246][SQL][DOCS] Correct documentation for null semantics of "NULL AND False"

This is an automated email from the ASF dual-hosted git repository.

yamamuro pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new e37859a  [SPARK-33246][SQL][DOCS] Correct documentation for null semantics of "NULL AND False"
e37859a is described below

commit e37859acffe0ccc6d2fe07683927c5701f11a265
Author: Stuart White <st...@spotright.com>
AuthorDate: Wed Oct 28 08:36:14 2020 +0900

    [SPARK-33246][SQL][DOCS] Correct documentation for null semantics of "NULL AND False"
    
    ### What changes were proposed in this pull request?
    
    The documentation of the Spark SQL null semantics states that "NULL AND False" yields NULL.  This is incorrect.  "NULL AND False" yields False.
    
    ```
    Seq[(java.lang.Boolean, java.lang.Boolean)](
      (null, false)
    )
      .toDF("left_operand", "right_operand")
      .withColumn("AND", 'left_operand && 'right_operand)
      .show(truncate = false)
    
    +------------+-------------+-----+
    |left_operand|right_operand|AND  |
    +------------+-------------+-----+
    |null        |false        |false|
    +------------+-------------+-----+
    ```
    
    I propose the documentation be updated to reflect that "NULL AND False" yields False.
    
    This contribution is my original work and I license it to the project under the project’s open source license.
    
    ### Why are the changes needed?
    
    This change improves the accuracy of the documentation.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes.  This PR introduces a fix to the documentation.
    
    ### How was this patch tested?
    
    Since this is only a documentation change, no tests were added.
    
    Closes #30161 from stwhit/SPARK-33246.
    
    Authored-by: Stuart White <st...@spotright.com>
    Signed-off-by: Takeshi Yamamuro <ya...@apache.org>
    (cherry picked from commit 7d11d972c356140d21909c6a62cdb8d813bd015e)
    Signed-off-by: Takeshi Yamamuro <ya...@apache.org>
---
 docs/sql-ref-null-semantics.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/sql-ref-null-semantics.md b/docs/sql-ref-null-semantics.md
index fb5d2a3..3c12e7a 100644
--- a/docs/sql-ref-null-semantics.md
+++ b/docs/sql-ref-null-semantics.md
@@ -125,7 +125,7 @@ The following tables illustrate the behavior of logical operators when one or bo
 |True|NULL|True|NULL|
 |False|NULL|NULL|False|
 |NULL|True|True|NULL|
-|NULL|False|NULL|NULL|
+|NULL|False|NULL|False|
 |NULL|NULL|NULL|NULL|
 
 |operand|NOT|


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