use of org.h2.table.MetaTable in project h2database by h2database.
the class PageStore method openMetaIndex.
private void openMetaIndex() {
CreateTableData data = new CreateTableData();
ArrayList<Column> cols = data.columns;
cols.add(new Column("ID", Value.INT));
cols.add(new Column("TYPE", Value.INT));
cols.add(new Column("PARENT", Value.INT));
cols.add(new Column("HEAD", Value.INT));
cols.add(new Column("OPTIONS", Value.STRING));
cols.add(new Column("COLUMNS", Value.STRING));
metaSchema = new Schema(database, 0, "", null, true);
data.schema = metaSchema;
data.tableName = "PAGE_INDEX";
data.id = META_TABLE_ID;
data.temporary = false;
data.persistData = true;
data.persistIndexes = true;
data.create = false;
data.session = pageStoreSession;
metaTable = new RegularTable(data);
metaIndex = (PageDataIndex) metaTable.getScanIndex(pageStoreSession);
metaObjects.clear();
metaObjects.put(-1, metaIndex);
}
use of org.h2.table.MetaTable in project h2database by h2database.
the class Database method initMetaTables.
private void initMetaTables() {
if (metaTablesInitialized) {
return;
}
synchronized (infoSchema) {
if (!metaTablesInitialized) {
for (int type = 0, count = MetaTable.getMetaTableTypeCount(); type < count; type++) {
MetaTable m = new MetaTable(infoSchema, -1 - type, type);
infoSchema.add(m);
}
metaTablesInitialized = true;
}
}
}
use of org.h2.table.MetaTable 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 || tbl instanceof MetaTable)
return new GridSqlTable(tbl);
// different table filters anyways. Thus the semantics will be correct.
if (tbl instanceof TableView) {
if (((TableView) tbl).isRecursive()) {
throw new IgniteSQLException("Recursive CTE ('WITH RECURSIVE (...)') is not supported.", IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
}
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 if (tbl instanceof MetaTable)
res = new GridSqlTable(tbl);
else
assert0(false, "Unexpected Table implementation [cls=" + tbl.getClass().getSimpleName() + ']');
h2ObjToGridObj.put(tbl, res);
}
return res;
}
Aggregations