You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2020/10/27 15:15:00 UTC

[jira] [Assigned] (SPARK-33246) Spark SQL null semantics documentation is incorrect

     [ https://issues.apache.org/jira/browse/SPARK-33246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apache Spark reassigned SPARK-33246:
------------------------------------

    Assignee:     (was: Apache Spark)

> Spark SQL null semantics documentation is incorrect
> ---------------------------------------------------
>
>                 Key: SPARK-33246
>                 URL: https://issues.apache.org/jira/browse/SPARK-33246
>             Project: Spark
>          Issue Type: Documentation
>          Components: Documentation
>    Affects Versions: 3.0.1
>            Reporter: Stuart White
>            Priority: Trivial
>
> The documentation of Spark SQL's null semantics is (I believe) incorrect.
> The documentation states that "NULL AND False" yields NULL, when in fact it yields False.
> {noformat}
> Seq[(java.lang.Boolean, java.lang.Boolean)](
>   (true, null),
>   (false, null),
>   (null, true),
>   (null, false),
>   (null, null)
> )
>   .toDF("left_operand", "right_operand")
>   .withColumn("OR", 'left_operand || 'right_operand)
>   .withColumn("AND", 'left_operand && 'right_operand)
>   .show(truncate = false)
> +------------+-------------+----+-----+
> |left_operand|right_operand|OR  |AND  |
> +------------+-------------+----+-----+
> |true        |null         |true|null |
> |false       |null         |null|false|
> |null        |true         |true|null |
> |null        |false        |null|false|  <---- this line is incorrect in the docs
> |null        |null         |null|null |
> +------------+-------------+----+-----+
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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