use of org.h2.table.TableBase in project ignite by apache.
the class GridSqlQueryParser method parseTable.
/**
* @param tbl Table.
*/
private GridSqlElement parseTable(Table tbl) {
GridSqlElement res = (GridSqlElement) h2ObjToGridObj.get(tbl);
if (res == null) {
// Table here is semantically equivalent to a table filter.
if (tbl instanceof TableBase)
return new GridSqlTable(tbl);
// different table filters anyways. Thus the semantics will be correct.
if (tbl instanceof TableView) {
Query qry = VIEW_QUERY.get((TableView) tbl);
res = new GridSqlSubquery(parseQuery(qry));
} else if (tbl instanceof FunctionTable)
res = parseExpression(FUNC_EXPR.get((FunctionTable) tbl), false);
else if (tbl instanceof RangeTable) {
res = new GridSqlFunction(GridSqlFunctionType.SYSTEM_RANGE);
res.addChild(parseExpression(RANGE_MIN.get((RangeTable) tbl), false));
res.addChild(parseExpression(RANGE_MAX.get((RangeTable) tbl), false));
} else
assert0(false, "Unexpected Table implementation [cls=" + tbl.getClass().getSimpleName() + ']');
h2ObjToGridObj.put(tbl, res);
}
return res;
}
Aggregations