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

Enclosing interface:
SearchArgument

public static interface SearchArgument.Builder

A builder object for contexts outside of Hive where it isn't easy to get a ExprNodeDesc. The user must call startOr, startAnd, or startNot before adding any leaves.


Method Summary
 SearchArgument.Builder between(String column, Object lower, Object upper)
          Add a between leaf to the current item on the stack.
 SearchArgument build()
          Build and return the SearchArgument that has been defined.
 SearchArgument.Builder end()
          Finish the current operation and pop it off of the stack.
 SearchArgument.Builder equals(String column, Object literal)
          Add an equals leaf to the current item on the stack.
 SearchArgument.Builder in(String column, Object... literal)
          Add an in leaf to the current item on the stack.
 SearchArgument.Builder isNull(String column)
          Add an is null leaf to the current item on the stack.
 SearchArgument.Builder lessThan(String column, Object literal)
          Add a less than leaf to the current item on the stack.
 SearchArgument.Builder lessThanEquals(String column, Object literal)
          Add a less than equals leaf to the current item on the stack.
 SearchArgument.Builder nullSafeEquals(String column, Object literal)
          Add a null safe equals leaf to the current item on the stack.
 SearchArgument.Builder startAnd()
          Start building an and operation and push it on the stack.
 SearchArgument.Builder startNot()
          Start building a not operation and push it on the stack.
 SearchArgument.Builder startOr()
          Start building an or operation and push it on the stack.
 

Method Detail

startOr

SearchArgument.Builder startOr()
Start building an or operation and push it on the stack.

Returns:
this

startAnd

SearchArgument.Builder startAnd()
Start building an and operation and push it on the stack.

Returns:
this

startNot

SearchArgument.Builder startNot()
Start building a not operation and push it on the stack.

Returns:
this

end

SearchArgument.Builder end()
Finish the current operation and pop it off of the stack. Each start call must have a matching end.

Returns:
this

lessThan

SearchArgument.Builder lessThan(String column,
                                Object literal)
Add a less than leaf to the current item on the stack.

Parameters:
column - the name of the column
literal - the literal
Returns:
this

lessThanEquals

SearchArgument.Builder lessThanEquals(String column,
                                      Object literal)
Add a less than equals leaf to the current item on the stack.

Parameters:
column - the name of the column
literal - the literal
Returns:
this

equals

SearchArgument.Builder equals(String column,
                              Object literal)
Add an equals leaf to the current item on the stack.

Parameters:
column - the name of the column
literal - the literal
Returns:
this

nullSafeEquals

SearchArgument.Builder nullSafeEquals(String column,
                                      Object literal)
Add a null safe equals leaf to the current item on the stack.

Parameters:
column - the name of the column
literal - the literal
Returns:
this

in

SearchArgument.Builder in(String column,
                          Object... literal)
Add an in leaf to the current item on the stack.

Parameters:
column - the name of the column
literal - the literal
Returns:
this

isNull

SearchArgument.Builder isNull(String column)
Add an is null leaf to the current item on the stack.

Parameters:
column - the name of the column
Returns:
this

between

SearchArgument.Builder between(String column,
                               Object lower,
                               Object upper)
Add a between leaf to the current item on the stack.

Parameters:
column - the name of the column
lower - the literal
upper - the literal
Returns:
this

build

SearchArgument build()
Build and return the SearchArgument that has been defined. All of the starts must have been ended before this call.

Returns:
the new SearchArgument


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