apache spark - error: not found: value sqlContext on EMR -
i on emr using spark 2. when ssh master node , run spark-shell can't see have access sqlcontext. there i'm missing?
[hadoop@ip-172-31-13-180 ~]$ spark-shell setting default log level "warn". adjust logging level use sc.setloglevel(newlevel). 16/11/10 21:07:05 warn client: neither spark.yarn.jars nor spark.yarn.archive set, falling uploading libraries under spark_home. 16/11/10 21:07:14 warn sparkcontext: use existing sparkcontext, configuration may not take effect. spark context web ui available @ http://172.31.13.180:4040 spark context available 'sc' (master = yarn, app id = application_1478720853870_0003). spark session available 'spark'. welcome ____ __ / __/__ ___ _____/ /__ _\ \/ _ \/ _ `/ __/ '_/ /___/ .__/\_,_/_/ /_/\_\ version 2.0.1 /_/ using scala version 2.11.8 (openjdk 64-bit server vm, java 1.8.0_111) type in expressions have them evaluated. type :help more information. scala> import org.apache.spark.sql.sqlcontext import org.apache.spark.sql.sqlcontext scala> sqlcontext <console>:25: error: not found: value sqlcontext sqlcontext ^ since i'm getting same error on local computer i've tried following no avail:
exported spark_local_ip
➜ play grep "spark_local_ip" ~/.zshrc export spark_local_ip=127.0.0.1 ➜ play source ~/.zshrc ➜ play spark-shell using spark's default log4j profile: org/apache/spark/log4j-defaults.properties setting default log level "warn". adjust logging level use sc.setloglevel(newlevel). 16/11/10 16:12:18 warn nativecodeloader: unable load native-hadoop library platform... using builtin-java classes applicable 16/11/10 16:12:19 warn sparkcontext: use existing sparkcontext, configuration may not take effect. spark context web ui available @ http://127.0.0.1:4040 spark context available 'sc' (master = local[*], app id = local-1478812339020). spark session available 'spark'. welcome ____ __ / __/__ ___ _____/ /__ _\ \/ _ \/ _ `/ __/ '_/ /___/ .__/\_,_/_/ /_/\_\ version 2.0.1 /_/ using scala version 2.11.8 (java hotspot(tm) 64-bit server vm, java 1.7.0_79) type in expressions have them evaluated. type :help more information. scala> sqlcontext <console>:24: error: not found: value sqlcontext sqlcontext ^ scala> my /etc/hosts contains following
127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost
spark 2.0 doesn't use sqlcontext anymore:
- use
sparksession(initialized inspark-shellspark). for legacy application can:
val sqlcontext = spark.sqlcontext
Comments
Post a Comment