Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.analysis.LimitElement Class Reference
Collaboration diagram for com.cloudera.impala.analysis.LimitElement:

Public Member Functions

 LimitElement (Expr limitExpr, Expr offsetExpr)
 
Expr getLimitExpr ()
 
Expr getOffsetExpr ()
 
long getLimit ()
 
boolean hasLimit ()
 
long getOffset ()
 
String toSql ()
 
void analyze (Analyzer analyzer) throws AnalysisException
 
LimitElement clone ()
 

Protected Member Functions

 LimitElement (LimitElement other)
 

Static Private Member Functions

static long evalIntegerExpr (Analyzer analyzer, Expr expr, String name) throws AnalysisException
 

Private Attributes

final Expr limitExpr_
 
final Expr offsetExpr_
 
long limit_
 
long offset_
 
boolean isAnalyzed_
 

Detailed Description

Combination of limit and offset expressions.

Definition at line 26 of file LimitElement.java.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.LimitElement.LimitElement ( Expr  limitExpr,
Expr  offsetExpr 
)
inline

Constructs the LimitElement.

Parameters
limitExprThe limit expression. May be null if there is no LIMIT clause.
offsetExprThe offset expression. May be null if there is no OFFSET clause.

Definition at line 38 of file LimitElement.java.

References com.cloudera.impala.analysis.LimitElement.isAnalyzed_, com.cloudera.impala.analysis.LimitElement.limit_, and com.cloudera.impala.analysis.LimitElement.offset_.

Referenced by com.cloudera.impala.analysis.LimitElement.clone().

Member Function Documentation

static long com.cloudera.impala.analysis.LimitElement.evalIntegerExpr ( Analyzer  analyzer,
Expr  expr,
String  name 
) throws AnalysisException
inlinestaticprivate

Evaluations an expression to a non-zero integral value, returned as a long. Throws if the expression cannot be evaluated, if the value evaluates to null, or if the result is negative. The 'name' parameter is used in exception messages, e.g. "LIMIT expression evaluates to NULL".

Definition at line 136 of file LimitElement.java.

References impala.name.

Referenced by com.cloudera.impala.analysis.LimitElement.analyze().

long com.cloudera.impala.analysis.LimitElement.getLimit ( )
inline

Returns the integer limit, evaluated from the limit expression. Must call analyze() first. If no limit was set, then -1 is returned.

Definition at line 64 of file LimitElement.java.

References com.cloudera.impala.analysis.LimitElement.isAnalyzed_, and com.cloudera.impala.analysis.LimitElement.limit_.

Referenced by com.cloudera.impala.analysis.SelectStmt.returnsSingleRow().

Expr com.cloudera.impala.analysis.LimitElement.getLimitExpr ( )
inline
long com.cloudera.impala.analysis.LimitElement.getOffset ( )
inline

Returns the integer offset, evaluated from the offset expression. Must call analyze() first. If no offsetExpr exists, then 0 (the default offset) is returned.

Definition at line 78 of file LimitElement.java.

References com.cloudera.impala.analysis.LimitElement.isAnalyzed_, and com.cloudera.impala.analysis.LimitElement.offset_.

Expr com.cloudera.impala.analysis.LimitElement.getOffsetExpr ( )
inline
boolean com.cloudera.impala.analysis.LimitElement.hasLimit ( )
inline

Member Data Documentation


The documentation for this class was generated from the following file: