spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiszk <...@git.apache.org>
Subject [GitHub] spark pull request #17302: [SPARK-19959][SQL] Fix to throw NullPointerExcept...
Date Wed, 22 Mar 2017 12:16:33 GMT
Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17302#discussion_r107398418
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/object.scala
---
    @@ -41,7 +41,20 @@ object CatalystSerde {
       }
     
       def generateObjAttr[T : Encoder]: Attribute = {
    -    AttributeReference("obj", encoderFor[T].deserializer.dataType, nullable = false)()
    +    val deserializer = encoderFor[T].deserializer
    +    val dataType = deserializer.dataType
    +    val nullable = if (deserializer.resolved) {
    +      deserializer.nullable
    +    } else {
    +      // Since deserializer is not resolved here, cannot access deserializer.nullable.
    --- End diff --
    
    This happens in the following calling context thru `ExternalRDD.apply`.
    ```java
    	at org.apache.spark.sql.catalyst.plans.logical.CatalystSerde$.generateObjAttr(object.scala:61)
    	at org.apache.spark.sql.execution.ExternalRDD$.apply(ExistingRDD.scala:73)
    	at org.apache.spark.sql.SparkSession.createDataset(SparkSession.scala:471)
    	at org.apache.spark.sql.SQLContext.createDataset(SQLContext.scala:393)
    	at org.apache.spark.sql.SQLImplicits.rddToDatasetHolder(SQLImplicits.scala:238)
    	at org.apache.spark.sql.Agg$$anonfun$18$$anonfun$apply$mcV$sp$4.apply$mcV$sp(MySuite.scala:202)
    	at org.apache.spark.sql.test.SQLTestUtils$class.withSQLConf(SQLTestUtils.scala:106)
    	at org.apache.spark.sql.Agg.withSQLConf(MySuite.scala:168)
    	at org.apache.spark.sql.Agg$$anonfun$18.apply$mcV$sp(MySuite.scala:193)
    	at org.apache.spark.sql.Agg$$anonfun$18.apply(MySuite.scala:193)
    	at org.apache.spark.sql.Agg$$anonfun$18.apply(MySuite.scala:193)
    ```
    
    [Here](https://github.com/apache/spark/pull/17302#discussion_r107345571) is a thread regarding
resolution of `deserializer`. 



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message