public class HiveContext extends SQLContext
Modifier and Type | Class and Description |
---|---|
static class |
org.apache.spark.sql.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.
|
String |
AUTO_BROADCASTJOIN_THRESHOLD() |
int |
autoBroadcastJoinThreshold()
Upper bound on the sizes (in bytes) of the tables qualified for the auto conversion to
a broadcast value during the physical executions of join operations.
|
void |
clear() |
String |
CODEGEN_ENABLED() |
boolean |
codegenEnabled()
When set to true, Spark SQL will use the Scala compiler at runtime to generate custom bytecode
that evaluates expressions found in queries.
|
String |
COLUMN_BATCH_SIZE() |
int |
columnBatchSize()
The number of rows that will be
|
String |
COMPRESS_CACHED() |
<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 |
DEFAULT_SIZE_IN_BYTES() |
long |
defaultSizeInBytes()
The default size in bytes to assign to a logical operator's estimation statistics.
|
String |
DIALECT() |
scala.collection.immutable.Map<String,String> |
getAllConfs()
Return all the configuration properties that have been set (i.e.
|
String |
getConf(String key)
Return the value of Spark SQL configuration property for the given key.
|
String |
getConf(String key,
String defaultValue)
Return the value of Spark SQL configuration property for the given key.
|
org.apache.spark.sql.SQLContext.SparkPlanner |
hivePlanner() |
SchemaRDD |
hiveql(String hqlQuery) |
SchemaRDD |
hql(String hqlQuery) |
boolean |
isParquetBinaryAsString()
When set to true, we always treat byte arrays in Parquet files as strings.
|
int |
numShufflePartitions()
Number of partitions to use for shuffle operators.
|
String |
PARQUET_BINARY_AS_STRING() |
String |
PARQUET_CACHE_METADATA() |
String |
PARQUET_COMPRESSION() |
String |
parquetCompressionCodec()
The compression codec for writing to a Parquetfile
|
<T> void |
registerFunction(String name,
scala.Function1<?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$1)
registerFunction 1-22 were generated by this script
|
<T> void |
registerFunction(String name,
scala.Function10<?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$10) |
<T> void |
registerFunction(String name,
scala.Function11<?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$11) |
<T> void |
registerFunction(String name,
scala.Function12<?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$12) |
<T> void |
registerFunction(String name,
scala.Function13<?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$13) |
<T> void |
registerFunction(String name,
scala.Function14<?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$14) |
<T> void |
registerFunction(String name,
scala.Function15<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$15) |
<T> void |
registerFunction(String name,
scala.Function16<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$16) |
<T> void |
registerFunction(String name,
scala.Function17<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$17) |
<T> void |
registerFunction(String name,
scala.Function18<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$18) |
<T> void |
registerFunction(String name,
scala.Function19<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$19) |
<T> void |
registerFunction(String name,
scala.Function2<?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$2) |
<T> void |
registerFunction(String name,
scala.Function20<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$20) |
<T> void |
registerFunction(String name,
scala.Function21<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$21) |
<T> void |
registerFunction(String name,
scala.Function22<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$22) |
<T> void |
registerFunction(String name,
scala.Function3<?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$3) |
<T> void |
registerFunction(String name,
scala.Function4<?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$4) |
<T> void |
registerFunction(String name,
scala.Function5<?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$5) |
<T> void |
registerFunction(String name,
scala.Function6<?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$6) |
<T> void |
registerFunction(String name,
scala.Function7<?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$7) |
<T> void |
registerFunction(String name,
scala.Function8<?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$8) |
<T> void |
registerFunction(String name,
scala.Function9<?,?,?,?,?,?,?,?,?,T> func,
scala.reflect.api.TypeTags.TypeTag<T> evidence$9) |
void |
registerPython(String name,
byte[] command,
java.util.Map<String,String> envVars,
java.util.List<String> pythonIncludes,
String pythonExec,
Accumulator<java.util.List<byte[]>> accumulator,
String stringDataType) |
void |
setConf(java.util.Properties props)
Set Spark SQL configuration properties.
|
void |
setConf(String key,
String value) |
java.util.Map<String,String> |
settings()
Only low degree of contention is expected for conf, thus NOT using ConcurrentHashMap.
|
String |
SHUFFLE_PARTITIONS() |
SchemaRDD |
sql(String sqlText)
Executes a SQL query using Spark, returning the result as a SchemaRDD.
|
String |
THRIFTSERVER_POOL() |
boolean |
useCompression()
When true tables cached using the in-memory columnar caching will be compressed.
|
applySchema, cacheTable, createParquetFile, createSchemaRDD, isCached, jsonFile, jsonFile, jsonFile, jsonRDD, jsonRDD, jsonRDD, logicalPlanToSparkQuery, parquetFile, registerRDDAsTable, sparkContext, table, uncacheTable
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialized, initializeIfNecessary, initializeLogging, initLock, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public HiveContext(SparkContext sc)
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)
public org.apache.spark.sql.SQLContext.SparkPlanner hivePlanner()
public String COMPRESS_CACHED()
public String COLUMN_BATCH_SIZE()
public String AUTO_BROADCASTJOIN_THRESHOLD()
public String DEFAULT_SIZE_IN_BYTES()
public String SHUFFLE_PARTITIONS()
public String CODEGEN_ENABLED()
public String DIALECT()
public String PARQUET_BINARY_AS_STRING()
public String PARQUET_CACHE_METADATA()
public String PARQUET_COMPRESSION()
public String THRIFTSERVER_POOL()
public java.util.Map<String,String> settings()
public boolean useCompression()
public String parquetCompressionCodec()
public int columnBatchSize()
public int numShufflePartitions()
public boolean codegenEnabled()
Defaults to false as this feature is currently experimental.
public int autoBroadcastJoinThreshold()
Hive setting: hive.auto.convert.join.noconditionaltask.size, whose default value is also 10000.
public long defaultSizeInBytes()
autoBroadcastJoinThreshold
, hence any logical operator
without a properly implemented estimation of this statistic will not be incorrectly broadcasted
in joins.public boolean isParquetBinaryAsString()
public void setConf(java.util.Properties props)
public String getConf(String key)
public String getConf(String key, String defaultValue)
defaultValue
.public scala.collection.immutable.Map<String,String> getAllConfs()
public void clear()
public void registerPython(String name, byte[] command, java.util.Map<String,String> envVars, java.util.List<String> pythonIncludes, String pythonExec, Accumulator<java.util.List<byte[]>> accumulator, String stringDataType)
public <T> void registerFunction(String name, scala.Function1<?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$1)
(1 to 22).map { x => val types = (1 to x).map(x => "_").reduce(_ + ", " + _) s""" def registerFunction[T: TypeTag](name: String, func: Function$x[$types, T]): Unit = { def builder(e: Seq[Expression]) = ScalaUdf(func, ScalaReflection.schemaFor(typeTag[T]).dataType, e) functionRegistry.registerFunction(name, builder) } """ }
public <T> void registerFunction(String name, scala.Function2<?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$2)
public <T> void registerFunction(String name, scala.Function3<?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$3)
public <T> void registerFunction(String name, scala.Function4<?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$4)
public <T> void registerFunction(String name, scala.Function5<?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$5)
public <T> void registerFunction(String name, scala.Function6<?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$6)
public <T> void registerFunction(String name, scala.Function7<?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$7)
public <T> void registerFunction(String name, scala.Function8<?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$8)
public <T> void registerFunction(String name, scala.Function9<?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$9)
public <T> void registerFunction(String name, scala.Function10<?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$10)
public <T> void registerFunction(String name, scala.Function11<?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$11)
public <T> void registerFunction(String name, scala.Function12<?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$12)
public <T> void registerFunction(String name, scala.Function13<?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$13)
public <T> void registerFunction(String name, scala.Function14<?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$14)
public <T> void registerFunction(String name, scala.Function15<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$15)
public <T> void registerFunction(String name, scala.Function16<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$16)
public <T> void registerFunction(String name, scala.Function17<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$17)
public <T> void registerFunction(String name, scala.Function18<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$18)
public <T> void registerFunction(String name, scala.Function19<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$19)
public <T> void registerFunction(String name, scala.Function20<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$20)
public <T> void registerFunction(String name, scala.Function21<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$21)
public <T> void registerFunction(String name, scala.Function22<?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,T> func, scala.reflect.api.TypeTags.TypeTag<T> evidence$22)