Search in sources :

Example 56 with VoltXMLElement

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());
    }
}
Also used : Statement(org.voltdb.catalog.Statement) VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement) Map(java.util.Map) NavigableMap(java.util.NavigableMap) CatalogMap(org.voltdb.catalog.CatalogMap) HashMap(java.util.HashMap)

Example 57 with VoltXMLElement

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());
    }
}
Also used : Statement(org.voltdb.catalog.Statement) VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement) Constraint(org.voltdb.catalog.Constraint)

Example 58 with VoltXMLElement

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);
    }
}
Also used : VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement)

Example 59 with VoltXMLElement

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;
}
Also used : VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement)

Example 60 with VoltXMLElement

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;
}
Also used : VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement)

Aggregations

VoltXMLElement (org.hsqldb_voltpatches.VoltXMLElement)62 AbstractExpression (org.voltdb.expressions.AbstractExpression)14 Constraint (org.voltdb.catalog.Constraint)13 VoltCompilerException (org.voltdb.compiler.VoltCompiler.VoltCompilerException)10 ArrayList (java.util.ArrayList)9 VoltType (org.voltdb.VoltType)7 TupleValueExpression (org.voltdb.expressions.TupleValueExpression)6 HSQLInterface (org.hsqldb_voltpatches.HSQLInterface)5 VoltXMLDiff (org.hsqldb_voltpatches.VoltXMLElement.VoltXMLDiff)5 Column (org.voltdb.catalog.Column)5 Table (org.voltdb.catalog.Table)5 Matcher (java.util.regex.Matcher)4 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 HSQLParseException (org.hsqldb_voltpatches.HSQLInterface.HSQLParseException)3 JSONException (org.json_voltpatches.JSONException)3 Index (org.voltdb.catalog.Index)3 Statement (org.voltdb.catalog.Statement)3 StmtSubqueryScan (org.voltdb.planner.parseinfo.StmtSubqueryScan)3 ExpressionType (org.voltdb.types.ExpressionType)3