spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheng Lian (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-12371) Make sure non-nullable arguments of NewInstance don't receive null input data
Date Mon, 21 Dec 2015 08:02:46 GMT

     [ 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message