org.apache.hadoop.hive.ql.parse
Class TableSample

java.lang.Object
  extended by org.apache.hadoop.hive.ql.parse.TableSample

public class TableSample
extends Object

This class stores all the information specified in the TABLESAMPLE clause. e.g. for the clause "FROM t TABLESAMPLE(1 OUT OF 2 ON c1) it will store the numerator 1, the denominator 2 and the list of expressions(in this case c1) in the appropriate fields. The afore-mentioned sampling clause causes the 1st bucket to be picked out of the 2 buckets created by hashing on c1.


Constructor Summary
TableSample(String num, String den, ArrayList<ASTNode> exprs)
          Constructs the TableSample given the numerator, denominator and the list of ON clause expressions
 
Method Summary
 int getDenominator()
          Gets the denominator
 ArrayList<ASTNode> getExprs()
          Gets the ON part's expression list
 boolean getInputPruning()
          Gets the flag that indicates whether input pruning is possible
 int getNumerator()
          Gets the numerator
 void setDenominator(int den)
          Sets the denominator
 void setExprs(ArrayList<ASTNode> exprs)
          Sets the expression list
 void setInputPruning(boolean inputPruning)
          Sets the flag that indicates whether input pruning is possible or not
 void setNumerator(int num)
          Sets the numerator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableSample

public TableSample(String num,
                   String den,
                   ArrayList<ASTNode> exprs)
Constructs the TableSample given the numerator, denominator and the list of ON clause expressions

Parameters:
num - The numerator
den - The denominator
exprs - The list of expressions in the ON part of the TABLESAMPLE clause
Method Detail

getNumerator

public int getNumerator()
Gets the numerator

Returns:
int

setNumerator

public void setNumerator(int num)
Sets the numerator

Parameters:
num - The numerator

getDenominator

public int getDenominator()
Gets the denominator

Returns:
int

setDenominator

public void setDenominator(int den)
Sets the denominator

Parameters:
den - The denominator

getExprs

public ArrayList<ASTNode> getExprs()
Gets the ON part's expression list

Returns:
ArrayList

setExprs

public void setExprs(ArrayList<ASTNode> exprs)
Sets the expression list

Parameters:
exprs - The expression list

getInputPruning

public boolean getInputPruning()
Gets the flag that indicates whether input pruning is possible

Returns:
boolean

setInputPruning

public void setInputPruning(boolean inputPruning)
Sets the flag that indicates whether input pruning is possible or not

Parameters:
inputPruning - true if input pruning is possible


Copyright © 2009 The Apache Software Foundation