Пример #1
0
void AbstractScanPlanNode::loadFromJSONObject(PlannerDomValue obj)
{
    m_target_table_name = obj.valueForKey("TARGET_TABLE_NAME").asStr();

    m_isEmptyScan = obj.hasNonNullKey("PREDICATE_FALSE");

    // Set the predicate (if any) only if it's not a trivial FALSE expression
    if (!m_isEmptyScan) {
        m_predicate.reset(loadExpressionFromJSONObject("PREDICATE", obj));
    }

    m_tcd = NULL;
    m_cteStmtId = -1;
    if (obj.hasKey("IS_CTE_SCAN") && obj.valueForKey("IS_CTE_SCAN").asBool()) {
        m_scanType = CTE_SCAN;
        m_cteStmtId = obj.valueForKey("CTE_STMT_ID").asInt();
    }
    else if (obj.hasNonNullKey("SUBQUERY_INDICATOR")) {
        m_scanType = SUBQUERY_SCAN;
    }
    else {
        m_scanType = PERSISTENT_TABLE_SCAN;
        VoltDBEngine* engine = ExecutorContext::getEngine();
        m_tcd = engine->getTableDelegate(m_target_table_name);
        if ( ! m_tcd) {
            VOLT_ERROR("Failed to retrieve target table from execution engine for PlanNode '%s'",
                       debug().c_str());
            //TODO: throw something
        }
    }
}
Пример #2
0
void IndexCountPlanNode::loadFromJSONObject(PlannerDomValue obj)
{
    AbstractScanPlanNode::loadFromJSONObject(obj);

    std::string endTypeString = obj.valueForKey("END_TYPE").asStr();
    m_end_type = stringToIndexLookup(endTypeString);

    std::string lookupTypeString = obj.valueForKey("LOOKUP_TYPE").asStr();
    m_lookup_type = stringToIndexLookup(lookupTypeString);

    m_target_index_name = obj.valueForKey("TARGET_INDEX_NAME").asStr();

    m_searchkey_expressions.loadExpressionArrayFromJSONObject("SEARCHKEY_EXPRESSIONS", obj);
    m_endkey_expressions.loadExpressionArrayFromJSONObject("ENDKEY_EXPRESSIONS", obj);

    m_skip_null_predicate.reset(loadExpressionFromJSONObject("SKIP_NULL_PREDICATE", obj));
}