GitHub user maropu opened a pull request:

    https://github.com/apache/spark/pull/17717

    [SPARK-20430][SQL] Initialise RangeExec parameters in a driver side

    ## What changes were proposed in this pull request?
    This pr initialised `RangeExec` parameters in a driver side.
    In the current master, a query below throws `NullPointerException`;
    ```
    sql("SET spark.sql.codegen.wholeStage=false")
    sql("SELECT * FROM range(1)").show
    
    17/04/20 17:11:05 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)
    java.lang.NullPointerException
            at 
org.apache.spark.sql.execution.SparkPlan.sparkContext(SparkPlan.scala:54)
            at 
org.apache.spark.sql.execution.RangeExec.numSlices(basicPhysicalOperators.scala:343)
            at 
org.apache.spark.sql.execution.RangeExec$$anonfun$20.apply(basicPhysicalOperators.scala:506)
            at 
org.apache.spark.sql.execution.RangeExec$$anonfun$20.apply(basicPhysicalOperators.scala:505)
            at 
org.apache.spark.rdd.RDD$$anonfun$mapPartitionsWithIndex$1$$anonfun$apply$26.apply(RDD.scala:844)
            at 
org.apache.spark.rdd.RDD$$anonfun$mapPartitionsWithIndex$1$$anonfun$apply$26.apply(RDD.scala:844)
            at 
org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
            at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
            at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
            at 
org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
            at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
            at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
            at 
org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
            at org.apache.spark.scheduler.Task.run(Task.scala:108)
            at 
org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:320)
            at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    ```
    
    ## How was this patch tested?
    Added a test in `DataFrameSuite`.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/maropu/spark SPARK-20430

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17717.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17717
    
----
commit da833f2df46be7a2866756da93957d090291189f
Author: Takeshi Yamamuro <yamam...@apache.org>
Date:   2017-04-21T13:23:04Z

    Initialize Range parameters in a driver side

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to