本文介绍了错误:未找到:值sqlContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个Python应用程序使用Apache星火来分析Twitter的数据流。

有什么办法,我可以使用Apache星火的功能,但不建立在Hadoop环境流。如何以单机模式运行Apache的火花?
我刚刚下载的二进制文件,并尝试运行火花外壳,得到NullPointerException异常。是否有人可以帮助。

 <&控制台GT;:10:错误:未找到:值sqlContext
进口sqlContext.implicits。<&控制台GT;:10:错误:未找到:值sqlContext
进口sqlContext.sql


解决方案

如果您有星火1.6工作,的Linux / Unix,如果你发现错误消息以下行:

  ...
 的java.net.UnknownHostException:其中,YOURHOSTNAME计算值:< YOURHOSTNAME计算值:在未知错误
 java.net.InetAddress.getLocalHost(InetAddress.java:1663)
 ...
 的java.net.UnknownHostException:引起< YOURHOSTNAME计算值:未知错误
 ...
 <&控制台GT;:16:错误:未找到:值sqlContext
                进口sqlContext.sql

添加在/ etc / hosts中:

  $ sudo的VI / etc / hosts文件
 ...
 127.0.0.1< YOURHOSTNAME>
 ...

这解决了我的情况下丢失的sqlContext价值问题。

I would like to create a python application to analyze twitter streaming data using Apache Spark.

Is there any way I can use the functionality of Apache Spark streaming without setting up the Hadoop environment. How to run Apache Spark in standalone mode?I just downloaded the binaries and tried to run spark-shell, getting NullPointerException. Can someone please help.

<console>:10: error: not found: value sqlContext
import sqlContext.implicits.

<console>:10: error: not found: value sqlContext
import sqlContext.sql
解决方案

If you work with Spark 1.6, Linux/Unix and if you find the following lines in the error message:

 ...
 java.net.UnknownHostException: <YOURHOSTNAME>: <YOURHOSTNAME>: unknown error at
 java.net.InetAddress.getLocalHost(InetAddress.java:1663)
 ...
 Caused by: java.net.UnknownHostException: <YOURHOSTNAME>: unknown error
 ...
 <console>:16: error: not found: value sqlContext
                import sqlContext.sql

add in /etc/hosts:

 $ sudo vi /etc/hosts
 ...
 127.0.0.1  <YOURHOSTNAME>
 ...

This solved in my case the missing sqlContext value problem.

这篇关于错误:未找到:值sqlContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 00:19