Class TableStorageHandler
- java.lang.Object
-
- org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler
-
- oracle.kv.hadoop.hive.table.TableStorageHandler
-
- All Implemented Interfaces:
Configurable
,HiveStorageHandler
,HiveStoragePredicateHandler
public class TableStorageHandler extends DefaultStorageHandler
Concrete implementation of TableStorageHandlerBase; which assumes that the data accessed from the desired Oracle NoSQL Database has been stored, and will be accessed, via the Table API.- Since:
- 3.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.ql.metadata.HiveStoragePredicateHandler
HiveStoragePredicateHandler.DecomposedPredicate
-
-
Field Summary
Fields Modifier and Type Field Description protected int
batchSize
protected Consistency
consistency
protected Direction
direction
protected String
fieldRangeProperty
protected JobConf
jobConf
protected String[]
kvHadoopHosts
protected String[]
kvHelperHosts
protected String
kvStoreName
protected int
maxBatches
protected int
maxRequests
protected String
primaryKeyProperty
protected String
tableName
protected long
timeout
protected TimeUnit
timeoutUnit
-
Constructor Summary
Constructors Constructor Description TableStorageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.HiveStoragePredicateHandler.DecomposedPredicate
decomposePredicate(JobConf jobConfig, Deserializer deserializer, ExprNodeDesc predicate)
Method required by the HiveStoragePredicateHandler interface.Class<? extends InputFormat>
getInputFormatClass()
Class<? extends OutputFormat>
getOutputFormatClass()
Class<? extends AbstractSerDe>
getSerDeClass()
-
Methods inherited from class org.apache.hadoop.hive.ql.metadata.DefaultStorageHandler
configureJobConf, getAuthorizationProvider, getConf, getMetaHook, setConf, toString
-
-
-
-
Field Detail
-
kvStoreName
protected String kvStoreName
-
kvHelperHosts
protected String[] kvHelperHosts
-
kvHadoopHosts
protected String[] kvHadoopHosts
-
tableName
protected String tableName
-
primaryKeyProperty
protected String primaryKeyProperty
-
fieldRangeProperty
protected String fieldRangeProperty
-
direction
protected Direction direction
-
consistency
protected Consistency consistency
-
timeout
protected long timeout
-
timeoutUnit
protected TimeUnit timeoutUnit
-
maxRequests
protected int maxRequests
-
batchSize
protected int batchSize
-
maxBatches
protected int maxBatches
-
jobConf
protected JobConf jobConf
-
-
Method Detail
-
getInputFormatClass
public Class<? extends InputFormat> getInputFormatClass()
- Specified by:
getInputFormatClass
in interfaceHiveStorageHandler
- Overrides:
getInputFormatClass
in classDefaultStorageHandler
-
getOutputFormatClass
public Class<? extends OutputFormat> getOutputFormatClass()
- Specified by:
getOutputFormatClass
in interfaceHiveStorageHandler
- Overrides:
getOutputFormatClass
in classDefaultStorageHandler
-
getSerDeClass
public Class<? extends AbstractSerDe> getSerDeClass()
- Specified by:
getSerDeClass
in interfaceHiveStorageHandler
- Overrides:
getSerDeClass
in classDefaultStorageHandler
-
configureInputJobProperties
public void configureInputJobProperties(TableDesc tableDesc, Map<String,String> jobProperties)
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
public void configureOutputJobProperties(TableDesc tableDesc, Map<String,String> jobProperties)
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
public 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. 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
-
-