TypeError: 'JavaPackage' object is not callable
<p>when I code the  spark sql API hiveContext.sql()</p>

<pre><code>from pyspark import SparkConf,SparkContext
from pyspark.sql import SQLContext,HiveContext

conf = SparkConf().setAppName("spark_sql")

sc = SparkContext(conf = conf)
hc = HiveContext(sc)

#rdd = sc.textFile("test.txt")
sqlContext = SQLContext(sc)
res = hc.sql("use teg_uee_app")
#for each in res.collect():
#    print(each[0])
sc.stop()
</code></pre>



<p>I got the following error:</p>

<pre><code>enFile "spark_sql.py", line 23, in &lt;module&gt;
res = hc.sql("use teg_uee_app")
File "/spark/python/pyspark/sql/context.py", line 580, in sql
    return DataFrame(self._ssql_ctx.sql(sqlQuery), self)
File "/spark/python/pyspark/sql/context.py", line 683, in _ssql_ctx
    self._scala_HiveContext = self._get_hive_ctx()
File "/spark/python/pyspark/sql/context.py", line 692, in _get_hive_ctx
return self._jvm.HiveContext(self._jsc.sc())
  TypeError: 'JavaPackage' object is not callable
</code></pre>

<p>how do I add SPARK_CLASSPATH or SparkContext.addFile?I don't have idea.</p>