org.apache.hadoop.hive.ql.io.sarg
Interface SearchArgument


public interface SearchArgument

Primary interface for SearchArgument, which are the subset of predicates that can be pushed down to the RecordReader. Each SearchArgument consists of a series of SearchClauses that must each be true for the row to be accepted by the filter. This requires that the filter be normalized into conjunctive normal form (CNF).


Nested Class Summary
static interface SearchArgument.Builder
          A builder object for contexts outside of Hive where it isn't easy to get a ExprNodeDesc.
static class SearchArgument.Factory
          A factory for creating SearchArguments.
static class SearchArgument.TruthValue
          The potential result sets of logical operations.
 
Field Summary
static SearchArgument.Factory FACTORY
          Use this instance to create SearchArgument instances.
 
Method Summary
 SearchArgument.TruthValue evaluate(SearchArgument.TruthValue[] leaves)
          Evaluate the entire predicate based on the values for the leaf predicates.
 List<PredicateLeaf> getLeaves()
          Get the leaf predicates that are required to evaluate the predicate.
 String toKryo()
          Serialize the SARG as a kyro object and return the base64 string.
 

Field Detail

FACTORY

static final SearchArgument.Factory FACTORY
Use this instance to create SearchArgument instances.

Method Detail

getLeaves

List<PredicateLeaf> getLeaves()
Get the leaf predicates that are required to evaluate the predicate. The list will have the duplicates removed.

Returns:
the list of leaf predicates

evaluate

SearchArgument.TruthValue evaluate(SearchArgument.TruthValue[] leaves)
Evaluate the entire predicate based on the values for the leaf predicates.

Parameters:
leaves - the value of each leaf predicate
Returns:
the value of hte entire predicate

toKryo

String toKryo()
Serialize the SARG as a kyro object and return the base64 string. Hive should replace the current XML-based AST serialization for predicate pushdown with the Kryo serialization of the SARG because the representation is much more compact and focused on what is needed for predicate pushdown.

Returns:
the serialized SARG


Copyright © 2014 The Apache Software Foundation. All rights reserved.