Package pyspark :: Module sql :: Class HiveContext
[frames] | no frames]

Class HiveContext

source code

SQLContext --+
             |
            HiveContext

A variant of Spark SQL that integrates with data stored in Hive.

Configuration for Hive is read from hive-site.xml on the classpath. It supports running both SQL and HiveQL commands.

Instance Methods
 
__init__(self, sparkContext, hiveContext=None)
Create a new HiveContext.
source code
 
hiveql(self, hqlQuery)
DEPRECATED: Use sql()
source code
 
hql(self, hqlQuery)
DEPRECATED: Use sql()
source code

Inherited from SQLContext: applySchema, cacheTable, inferSchema, jsonFile, jsonRDD, parquetFile, registerFunction, registerRDDAsTable, sql, table, uncacheTable

Method Details

__init__(self, sparkContext, hiveContext=None)
(Constructor)

source code 

Create a new HiveContext.

Parameters:
  • sparkContext - The SparkContext to wrap.
  • hiveContext - An optional JVM Scala HiveContext. If set, we do not instatiate a new HiveContext in the JVM, instead we make all calls to this object.
Overrides: SQLContext.__init__