Github user andrewor14 commented on a diff in the pull request: https://github.com/apache/spark/pull/12851#discussion_r62220691 --- Diff: examples/src/main/scala/org/apache/spark/examples/sql/hive/HiveFromSpark.scala --- @@ -36,13 +36,14 @@ object HiveFromSpark { def main(args: Array[String]) { val sparkConf = new SparkConf().setAppName("HiveFromSpark") - val sc = new SparkContext(sparkConf) // A hive context adds support for finding tables in the MetaStore and writing queries // using HiveQL. Users who do not have an existing Hive deployment can still create a // HiveContext. When not configured by the hive-site.xml, the context automatically // creates metastore_db and warehouse in the current directory. - val sparkSession = SparkSession.withHiveSupport(sc) + val sparkSession = SparkSession.builder.config(sparkConf).enableHiveSupport().getOrCreate() + val sc = sparkSession.sparkContext --- End diff -- github won't let me comment down there, but in L78 please replace `sc.stop` with `spark.stop`
--- 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