Exemple #1
0
int
AbstractScanPlanNode::getColumnIndexFromGuid(int guid,
                                             const catalog::Database* db) const
{
    // if the scan node has an inlined projection, then we
    // want to look up the column index in the projection
    AbstractPlanNode* projection =
        getInlinePlanNode(PLAN_NODE_TYPE_PROJECTION);
    if (projection != NULL)
    {
        return projection->getColumnIndexFromGuid(guid, db);
    }
    else
    {
        string name = "";
        for (int i = 0; i < m_outputColumnGuids.size(); i++)
        {
            if (guid == m_outputColumnGuids[i])
            {
                return getColumnIndexFromName(m_outputColumnNames[i], db);
            }
        }
    }
    return -1;
}
Exemple #2
0
int
AbstractPlanNode::getColumnIndexFromGuid(int guid,
                                         const catalog::Database* db) const
{
    if (m_children.size() != 1)
    {
        return -1;
    }
    AbstractPlanNode* child = m_children[0];
    if (child == NULL)
    {
        return -1;
    }
    return child->getColumnIndexFromGuid(guid, db);
}