public class HiveContext extends SQLContext
SQLConf.Deprecated$
Constructor and Description |
---|
HiveContext(SparkContext sc) |
Modifier and Type | Method and Description |
---|---|
void |
analyze(String tableName)
Analyzes the given table in the current database to generate statistics, which will be
used in query optimizations.
|
boolean |
convertMetastoreParquet()
When true, enables an experimental feature where metastore tables that use the parquet SerDe
are automatically converted to use the Spark SQL parquet table scan, instead of the Hive
SerDe.
|
<A extends scala.Product> |
createTable(String tableName,
boolean allowExisting,
scala.reflect.api.TypeTags.TypeTag<A> evidence$1)
Creates a table using the schema of the given class.
|
String |
dialect()
The SQL dialect that is used when parsing queries.
|
org.apache.spark.sql.SQLContext.SparkPlanner |
hivePlanner() |
SchemaRDD |
hiveql(String hqlQuery) |
SchemaRDD |
hql(String hqlQuery) |
void |
setConf(String key,
String value)
Set the given Spark SQL configuration property.
|
SchemaRDD |
sql(String sqlText)
Executes a SQL query using Spark, returning the result as a SchemaRDD.
|
applySchema, applySchemaToPythonRDD, applySchemaToPythonRDD, baseRelationToSchemaRDD, createParquetFile, createSchemaRDD, dropTempTable, extraStrategies, jsonFile, jsonFile, jsonFile, jsonRDD, jsonRDD, jsonRDD, logicalPlanToSparkQuery, parquetFile, parseDataType, registerRDDAsTable, sparkContext, table
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
autoBroadcastJoinThreshold, clear, codegenEnabled, columnBatchSize, columnNameOfCorruptRecord, defaultSizeInBytes, externalSortEnabled, getAllConfs, getConf, getConf, inMemoryPartitionPruning, isParquetBinaryAsString, numShufflePartitions, parquetCompressionCodec, parquetFilterPushDown, setConf, settings, useCompression
cachedData, cacheLock, cacheQuery, cacheTable, clearCache, invalidateCache, isCached, lookupCachedData, lookupCachedData, readLock, tryUncacheQuery, uncacheQuery, uncacheTable, useCachedData, writeLock
registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerFunction, registerPython
public HiveContext(SparkContext sc)
public String dialect()
SQLConf
When using a HiveContext, this value defaults to 'hiveql', which uses the Hive 0.12.0 HiveQL parser. Users can change this to 'sql' if they want to run queries that aren't supported by HiveQL (e.g., SELECT 1).
Note that the choice of dialect does not affect things like what tables are available or how query execution is performed.
public boolean convertMetastoreParquet()
public SchemaRDD sql(String sqlText)
SQLContext
sql
in class SQLContext
public SchemaRDD hiveql(String hqlQuery)
public SchemaRDD hql(String hqlQuery)
public <A extends scala.Product> void createTable(String tableName, boolean allowExisting, scala.reflect.api.TypeTags.TypeTag<A> evidence$1)
tableName
- The name of the table to create.allowExisting
- When false, an exception will be thrown if the table already exists.public void analyze(String tableName)
Right now, it only supports Hive tables and it only updates the size of a Hive table in the Hive metastore.
public void setConf(String key, String value)
SQLConf
public org.apache.spark.sql.SQLContext.SparkPlanner hivePlanner()