Search in sources :

Example 61 with VoltXMLElement

use of org.hsqldb_voltpatches.VoltXMLElement in project voltdb by VoltDB.

the class ParsedUnionStmt method parse.

@Override
void parse(VoltXMLElement stmtNode) {
    String type = stmtNode.attributes.get("uniontype");
    // Set operation type
    m_unionType = UnionType.valueOf(type);
    int idx = 0;
    VoltXMLElement limitElement = null, offsetElement = null, orderbyElement = null;
    for (VoltXMLElement child : stmtNode.children) {
        if (SELECT_NODE_NAME.equals(child.name) || UNION_NODE_NAME.equals(child.name)) {
            assert (idx < m_children.size());
            AbstractParsedStmt nextStmt = m_children.get(idx++);
            nextStmt.parse(child);
        } else if (child.name.equals("limit")) {
            limitElement = child;
        } else if (child.name.equals("offset")) {
            offsetElement = child;
        } else if (child.name.equals("ordercolumns")) {
            orderbyElement = child;
        }
    }
    // Parse LIMIT/OFFSET
    ParsedSelectStmt.parseLimitAndOffset(limitElement, offsetElement, m_limitOffset);
    // Parse ORDER BY
    if (orderbyElement != null) {
        parseOrderColumns(orderbyElement);
        placeTVEsForOrderby();
    }
    // prepare the limit plan node if it needs one.
    if (hasLimitOrOffset()) {
        ParsedSelectStmt.prepareLimitPlanNode(this, m_limitOffset);
    }
}
Also used : VoltXMLElement(org.hsqldb_voltpatches.VoltXMLElement)

Example 62 with VoltXMLElement

use of org.hsqldb_voltpatches.VoltXMLElement in project voltdb by VoltDB.

the class TestVoltXMLElement method makeNamedElement.

VoltXMLElement makeNamedElement(String elementName, String attName) {
    VoltXMLElement e = new VoltXMLElement(elementName);
    e.attributes.put("name", attName);
    return e;
}
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