Class TableStorageHandler
- All Implemented Interfaces:
Configurable
,HiveStorageHandler
,HiveStoragePredicateHandler
- Since:
- 3.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler
HiveStoragePredicateHandler.DecomposedPredicate
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configureInputJobProperties
(TableDesc tableDesc, Map<String, String> jobProperties) Creates a configuration for job input.void
configureOutputJobProperties
(TableDesc tableDesc, Map<String, String> jobProperties) Using semantics identical to the semantics of theconfigureInputJobProperties
method, creates a configuration for job output.void
configureTableJobProperties
(TableDesc tableDesc, Map<String, String> jobProperties) Although this method was originally intended to configure properties for a job based on the definition of the source or target table the job accesses, this method is now deprecated in Hive.decomposePredicate
(JobConf jobConfig, Deserializer deserializer, ExprNodeDesc predicate) Method required by the HiveStoragePredicateHandler interface.Class<? extends InputFormat>
Class<? extends OutputFormat>
Class<? extends AbstractSerDe>
Methods inherited from class org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler
configureJobConf, getAuthorizationProvider, getConf, getMetaHook, setConf, toString
-
Field Details
-
kvStoreName
-
kvHelperHosts
-
kvHadoopHosts
-
tableName
-
-
fieldRangeProperty
-
direction
-
consistency
-
timeout
protected long timeout -
timeoutUnit
-
maxRequests
protected int maxRequests -
batchSize
protected int batchSize -
maxBatches
protected int maxBatches -
jobConf
-
-
Constructor Details
-
TableStorageHandler
public TableStorageHandler()
-
-
Method Details
-
getInputFormatClass
- Specified by:
getInputFormatClass
in interfaceHiveStorageHandler
- Overrides:
getInputFormatClass
in classDefaultStorageHandler
-
getOutputFormatClass
- Specified by:
getOutputFormatClass
in interfaceHiveStorageHandler
- Overrides:
getOutputFormatClass
in classDefaultStorageHandler
-
getSerDeClass
- Specified by:
getSerDeClass
in interfaceHiveStorageHandler
- Overrides:
getSerDeClass
in classDefaultStorageHandler
-
configureInputJobProperties
Creates a configuration for job input. This method provides the mechanism for populating this StorageHandler's configuration (returned byJobContext.getConfiguration
) with the properties that may be needed by the handler's bundled artifacts; for example, theInputFormat
class, theSerDe
class, etc. returned by this handler. Any key value pairs set in thejobProperties
argument are guaranteed to be set in the job's configuration object; and any "context" information associated with the job can be retrieved from the givenTableDesc
parameter.Note that implementations of this method must be idempotent. That is, when this method is invoked more than once with the same
tableDesc
values for a given job, the key value pairs injobProperties
, as well as any external state set by this method, should be the same after each invocation. How this invariant guarantee is achieved is left as an implementation detail; although to support this guarantee, changes should only be made to the contents ofjobProperties
, but never totableDesc
.- Specified by:
configureInputJobProperties
in interfaceHiveStorageHandler
- Overrides:
configureInputJobProperties
in classDefaultStorageHandler
-
configureOutputJobProperties
Using semantics identical to the semantics of theconfigureInputJobProperties
method, creates a configuration for job output. For more detail, refer to the description of theconfigureInputJobProperties
method.- Specified by:
configureOutputJobProperties
in interfaceHiveStorageHandler
- Overrides:
configureOutputJobProperties
in classDefaultStorageHandler
-
configureTableJobProperties
Although this method was originally intended to configure properties for a job based on the definition of the source or target table the job accesses, this method is now deprecated in Hive. The methodsconfigureInputJobProperties
andconfigureOutputJobProperties
should be used instead.- Specified by:
configureTableJobProperties
in interfaceHiveStorageHandler
- Overrides:
configureTableJobProperties
in classDefaultStorageHandler
-
decomposePredicate
public HiveStoragePredicateHandler.DecomposedPredicate decomposePredicate(JobConf jobConfig, Deserializer deserializer, ExprNodeDesc predicate) Method required by the HiveStoragePredicateHandler interface.This method validates the components of the given predicate and ultimately produces the following artifacts:
- a Hive object representing the predicate that will be pushed to the backend for server side filtering
- the String form of the computed predicate to push; which can be passed to the server via the ONSQL query mechanism
- a Hive object consisting of the remaining components of the original predicate input to this method -- referred to as the 'residual' predicate; which represents the criteria the Hive infrastructure will apply (on the client side) to the results returned after server side filtering has been performed
Note that because the Hive built-in IndexPredicateAnalyzer produces only predicates that consist of 'AND' statements, and which correspond to PrimaryKey based or IndexKey based predicates, if the Hive built-in analyzer does not produce a predicate to push, then a custom analyzer that extends the capabilities of the Hive built-in analyzer is employed. This extended analyzer handles statements that the built-in analyzer does not handle. Additionally, whereas the built-in analyzer populates a List of Hive IndexSearchConditions corresponding to the filtering criteria of the predicate to push, the extended analyzer populates an ArrayDeque in which the top (first element) of the Deque is a Hive object consisting of all the components of the original input predicate, but with 'invalid' operators replaced with 'valid' operators; for example, with 'IN list' replaced with 'OR' statements.
In each case, translateSearchConditions constructs the appropriate Hive predicate to push from the contents of the given Collection; either List of IndexSearchCondition, or ArrayDeque.
- Specified by:
decomposePredicate
in interfaceHiveStoragePredicateHandler
-