ImportError: cannot import name SqlContext

Hello Friends,

I am using Hadoop 2.6.0-cdh5.4.2 on vmware
I am not able to run following command on pyspark shell running in yarn mode:

from pyspark.sql import SqlContext

After entering,I am getting the error:

>>> from pyspark.sql import SqlContext
Traceback (most recent call last):
** File “”, line 1, in **
ImportError: cannot import name SqlContext

If anyone has faced the same issue,please help me out???

It should be SQLContext I.e import SQLContext.

1 Like

Thanks N_Chakote!!!I
It worked!!!