Class GridSqlQuery
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.h2.sql.GridSqlStatement
-
- org.apache.ignite.internal.processors.query.h2.sql.GridSqlQuery
-
- All Implemented Interfaces:
GridSqlAst
- Direct Known Subclasses:
GridSqlSelect,GridSqlUnion
public abstract class GridSqlQuery extends GridSqlStatement implements GridSqlAst
SQL Query AST.
-
-
Field Summary
Fields Modifier and Type Field Description static intLIMIT_CHILDstatic intOFFSET_CHILDprotected List<GridSqlSortColumn>sort-
Fields inherited from class org.apache.ignite.internal.processors.query.h2.sql.GridSqlStatement
limit
-
-
Constructor Summary
Constructors Constructor Description GridSqlQuery()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddSort(GridSqlSortColumn sortCol)<E extends GridSqlAst>
Echild()Get the first child.<E extends GridSqlAst>
Echild(int childIdx)Get child by index.<E extends GridSqlAst>
voidchild(int childIdx, E child)Set child.voidclearSort()protected abstract GridSqlAstcolumn(int col)protected voidgetSortLimitSQL(org.h2.util.StatementBuilder buff)booleanhasOffsetLimit()Whether offset or limit exists.protected static <E extends GridSqlAst>
EmaskNull(GridSqlAst x, GridSqlAst dflt)GridSqlAstoffset()voidoffset(GridSqlAst offset)GridSqlTyperesultType()abstract booleanskipMergeTable()List<GridSqlSortColumn>sort()protected abstract intvisibleColumns()-
Methods inherited from class org.apache.ignite.internal.processors.query.h2.sql.GridSqlStatement
explain, explain, getSQL, limit, limit, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.query.h2.sql.GridSqlAst
getSQL, size
-
-
-
-
Field Detail
-
OFFSET_CHILD
public static final int OFFSET_CHILD
- See Also:
- Constant Field Values
-
LIMIT_CHILD
public static final int LIMIT_CHILD
- See Also:
- Constant Field Values
-
sort
protected List<GridSqlSortColumn> sort
-
-
Method Detail
-
offset
public GridSqlAst offset()
- Returns:
- Offset.
-
offset
public void offset(GridSqlAst offset)
- Parameters:
offset- Offset.
-
sort
public List<GridSqlSortColumn> sort()
- Returns:
- Sort.
-
clearSort
public void clearSort()
-
addSort
public void addSort(GridSqlSortColumn sortCol)
- Parameters:
sortCol- The sort column.
-
visibleColumns
protected abstract int visibleColumns()
- Returns:
- Number of visible columns.
-
column
protected abstract GridSqlAst column(int col)
- Parameters:
col- Column index.- Returns:
- Expression for column index.
-
resultType
public GridSqlType resultType()
- Specified by:
resultTypein interfaceGridSqlAst- Returns:
- Optional expression result type (if this is an expression and result type is known).
-
child
public <E extends GridSqlAst> E child()
Get the first child.- Specified by:
childin interfaceGridSqlAst- Returns:
- Child element.
-
child
public <E extends GridSqlAst> E child(int childIdx)
Get child by index.- Specified by:
childin interfaceGridSqlAst- Parameters:
childIdx- Index of the requested child.- Returns:
- Child element.
-
maskNull
protected static <E extends GridSqlAst> E maskNull(GridSqlAst x, GridSqlAst dflt)
- Parameters:
x- Element.- Returns:
- Empty placeholder if the element is
null.
-
child
public <E extends GridSqlAst> void child(int childIdx, E child)
Set child.- Specified by:
childin interfaceGridSqlAst- Parameters:
childIdx- Index of the requested child.child- Child element.
-
skipMergeTable
public abstract boolean skipMergeTable()
- Returns:
- If this is a simple query with no conditions, expressions, sorting, etc...
-
getSortLimitSQL
protected void getSortLimitSQL(org.h2.util.StatementBuilder buff)
- Parameters:
buff- Statement builder.
-
hasOffsetLimit
public boolean hasOffsetLimit()
Whether offset or limit exists.- Returns:
trueIf we have OFFSET LIMIT.
-
-