use of org.hsqldb_voltpatches.VoltXMLElement in project voltdb by VoltDB.
the class VoltCompiler method compileRowLimitDeleteStmts.
private void compileRowLimitDeleteStmts(Database db, HSQLInterface hsql, Collection<Map.Entry<Statement, VoltXMLElement>> deleteStmtXmlEntries) throws VoltCompilerException {
for (Map.Entry<Statement, VoltXMLElement> entry : deleteStmtXmlEntries) {
Statement stmt = entry.getKey();
VoltXMLElement xml = entry.getValue();
// choose DeterminismMode.FASTER for determinism, and rely on the planner to error out
// if we generated a plan that is content-non-deterministic.
StatementCompiler.compileStatementAndUpdateCatalog(this, hsql, db, m_estimates, stmt, xml, stmt.getSqltext(), // no user-supplied join order
null, DeterminismMode.FASTER, StatementPartitioning.partitioningForRowLimitDelete());
}
}
use of org.hsqldb_voltpatches.VoltXMLElement in project voltdb by VoltDB.
the class MaterializedViewProcessor method compileFallbackQueriesAndUpdateCatalog.
// Compile the fallback query XMLs, add the plans into the catalog statement (ENG-8641).
private void compileFallbackQueriesAndUpdateCatalog(Database db, String query, List<VoltXMLElement> fallbackQueryXMLs, MaterializedViewInfo matviewinfo) throws VoltCompilerException {
DatabaseEstimates estimates = new DatabaseEstimates();
for (int i = 0; i < fallbackQueryXMLs.size(); ++i) {
String key = String.valueOf(i);
Statement fallbackQueryStmt = matviewinfo.getFallbackquerystmts().add(key);
VoltXMLElement fallbackQueryXML = fallbackQueryXMLs.get(i);
fallbackQueryStmt.setSqltext(query);
StatementCompiler.compileStatementAndUpdateCatalog(m_compiler, m_hsql, db, estimates, fallbackQueryStmt, fallbackQueryXML, fallbackQueryStmt.getSqltext(), // no user-supplied join order
null, DeterminismMode.FASTER, StatementPartitioning.forceSP());
}
}
use of org.hsqldb_voltpatches.VoltXMLElement in project voltdb by VoltDB.
the class VoltXMLElementHelper method getFirstChild.
public static VoltXMLElement getFirstChild(VoltXMLElement root, String name, boolean createIfNotExist) {
if (root == null || name == null) {
return null;
}
List<VoltXMLElement> elementList = root.findChildren(name);
if (elementList.size() < 1) {
if (createIfNotExist) {
VoltXMLElement retval = new VoltXMLElement(name);
root.children.add(retval);
return retval;
} else {
return null;
}
} else {
return elementList.get(0);
}
}
use of org.hsqldb_voltpatches.VoltXMLElement in project voltdb by VoltDB.
the class VoltXMLElementHelper method buildValueElement.
public static VoltXMLElement buildValueElement(String elementId, boolean isParam, String value, String valueType) {
if (elementId == null) {
return null;
}
VoltXMLElement retval = new VoltXMLElement("value");
retval.attributes.put("id", elementId);
if (isParam) {
retval.attributes.put("isparam", "true");
return retval;
}
if (value == null || valueType == null) {
return null;
}
retval.attributes.put("value", value);
retval.attributes.put("valuetype", valueType);
return retval;
}
use of org.hsqldb_voltpatches.VoltXMLElement in project voltdb by VoltDB.
the class VoltXMLElementHelper method buildOrderColumnsElement.
public static VoltXMLElement buildOrderColumnsElement(VoltXMLElement orderbyColumn, boolean desc, String elementId) {
VoltXMLElement retval = new VoltXMLElement("orderby");
if (desc) {
retval.attributes.put("desc", "true");
}
retval.attributes.put("id", elementId);
retval.children.add(orderbyColumn);
return retval;
}
Aggregations