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

Cheng Lian updated SPARK-12371:
-------------------------------
    Summary: Make sure non-nullable arguments of NewInstance don't receive null 
input data  (was: Make sure Dataset nullability conforms to its underlying 
logical plan)

> Make sure non-nullable arguments of NewInstance don't receive null input data
> -----------------------------------------------------------------------------
>
>                 Key: SPARK-12371
>                 URL: https://issues.apache.org/jira/browse/SPARK-12371
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 1.6.0, 2.0.0
>            Reporter: Cheng Lian
>            Assignee: Apache Spark
>
> Currently it's possible to construct a Dataset with different nullability 
> from its underlying logical plan, which should be caught during analysis 
> phase:
> {code}
> val rowRDD = sqlContext.sparkContext.parallelize(Seq(Row("hello"), Row(null)))
> val schema = StructType(Seq(StructField("_1", StringType, nullable = false)))
> val df = sqlContext.createDataFrame(rowRDD, schema)
> df.as[Tuple1[String]].collect().foreach(println)
> // Output:
> //
> //   (hello)
> //   (null)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to