You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/05/21 04:21:22 UTC

[jira] [Updated] (SPARK-15191) createDataFrame() should mark fields that are known not to be null as not nullable

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

Hyukjin Kwon updated SPARK-15191:
---------------------------------
    Labels: bulk-closed  (was: )

> createDataFrame() should mark fields that are known not to be null as not nullable
> ----------------------------------------------------------------------------------
>
>                 Key: SPARK-15191
>                 URL: https://issues.apache.org/jira/browse/SPARK-15191
>             Project: Spark
>          Issue Type: Improvement
>          Components: PySpark, SQL
>    Affects Versions: 1.6.1
>            Reporter: Nicholas Chammas
>            Priority: Minor
>              Labels: bulk-closed
>
> Here's a brief reproduction:
> {code}
> >>> numbers = sqlContext.createDataFrame(
> ...     data=[(1,), (2,), (3,), (4,), (5,)],
> ...     samplingRatio=1  # go through all the data please!
> ... )
> >>> numbers.printSchema()
> root
>  |-- _1: long (nullable = true)
> {code}
> The field is marked as nullable even though none of the data is null and we had {{createDataFrame()}} go through all the data.
> In situations like this, shouldn't {{createDataFrame()}} return a DataFrame with the field marked as not nullable?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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