[ 
https://issues.apache.org/jira/browse/SPARK-17261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15439613#comment-15439613
 ] 

Dongjoon Hyun commented on SPARK-17261:
---------------------------------------

Hi, [~dakghar]

For me, those seems not to work even in `spark-shell`. Could you add a `show` 
at the end? I tested and got the same result in 2.0.0 and current master branch.
{code}
scala> import org.apache.spark.sql.SparkSession
scala> val spark = SparkSession.builder.enableHiveSupport().getOrCreate()
scala> spark.sql("show databases").show
+------------+
|databaseName|
+------------+
|     default|
+------------+

scala> spark.stop()
scala> val spark = SparkSession.builder.enableHiveSupport().getOrCreate()
scala> spark.sql("show databases").show
16/08/26 12:09:22 ERROR Schema: Failed initialising database.
Unable to open a test connection to the given database. JDBC url = 
jdbc:derby:;databaseName=metastore_db;create=true, username = APP. Terminating 
connection pool (set lazyInit to true if you expect to start your database 
after your app). Original Exception: ------
java.sql.SQLException: Failed to start database 'metastore_db' with class 
loader org.apache.spark.sql.hive.client.IsolatedClientLoader$$anon$1@6b60d99c, 
see the next exception for details.
{code}

> Using HiveContext after re-creating SparkContext in Spark 2.0 throws 
> "Java.lang.illegalStateException: Cannot call methods on a stopped 
> sparkContext"
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-17261
>                 URL: https://issues.apache.org/jira/browse/SPARK-17261
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 2.0.0
>         Environment: Amazon AWS EMR 5.0
>            Reporter: Rahul Jain
>             Fix For: 2.0.0
>
>
> After stopping SparkSession if we recreate it and use HiveContext in it. it 
> will throw error.
> Steps to reproduce:
> spark = SparkSession.builder.enableHiveSupport().getOrCreate()
> spark.sql("show databases")
> spark.stop()
> spark = SparkSession.builder.enableHiveSupport().getOrCreate()
> spark.sql("show databases")
> "Java.lang.illegalStateException: Cannot call methods on a stopped 
> sparkContext"
> Above error occurs only in case of Pyspark not in SparkShell



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to