Package org.apache.cassandra.cql.common

Examples of org.apache.cassandra.cql.common.ColumnMapExpr


        {
            throw new SemanticException(CompilerErrorMsg.INVALID_TYPE.getMsg(ast));
        }
       
        int size = ast.getChildCount();
        ColumnMapExpr result = new ColumnMapExpr();
        for (int idx = 0; idx < size; idx++)
        {
            CommonTree entryNode = (CommonTree)(ast.getChild(idx));
            OperandDef columnKey   = getSimpleExpr((CommonTree)(entryNode.getChild(0)));
            OperandDef columnValue = getSimpleExpr((CommonTree)(entryNode.getChild(1)));           

            Pair<OperandDef, OperandDef> entry = new Pair<OperandDef, OperandDef>(columnKey, columnValue);
            result.add(entry);
        }
        return result;
    }
View Full Code Here


        SuperColumnMapExpr result = new SuperColumnMapExpr();
        for (int idx = 0; idx < size; idx++)
        {
            CommonTree entryNode = (CommonTree)(ast.getChild(idx));
            OperandDef    superColumnKey = getSimpleExpr((CommonTree)(entryNode.getChild(0)));
            ColumnMapExpr columnMapExpr  = getColumnMapExpr((CommonTree)(entryNode.getChild(1)));           

            Pair<OperandDef, ColumnMapExpr> entry = new Pair<OperandDef, ColumnMapExpr>(superColumnKey, columnMapExpr);
            result.add(entry);
        }
        return result;
View Full Code Here

                plan = new SetUniqueKey(cfMetaData, rowKey, superColumnKey, columnKey, value);
            }
            else if (dimensionCnt == 1)
            {
                // Case: set table.super_cf['key']['supercolumn'] = <column_map>;
                ColumnMapExpr columnMapExpr = getColumnMapExpr(valueNode);               
                ConstantOperand superColumnKey = new ConstantOperand(getColumn(columnFamilySpec, 0));
                plan = new SetColumnMap(cfMetaData, rowKey, superColumnKey, columnMapExpr);
            }
            else
            {
                // Case: set table.super_cf['key'] = <super_column_map>;
                logger_.assertLog(dimensionCnt == 0, "invalid dimensionCnt: " + dimensionCnt);
                SuperColumnMapExpr superColumnMapExpr = getSuperColumnMapExpr(valueNode);               
                plan = new SetSuperColumnMap(cfMetaData, rowKey, superColumnMapExpr);
            }
        }
        else  // Standard column family
        {
            if (dimensionCnt == 1)
            {
                // Case: set table.standard_cf['key']['column'] = 'value'
                OperandDef value = getSimpleExpr(valueNode);               
                ConstantOperand columnKey = new ConstantOperand(getColumn(columnFamilySpec, 0));
                plan = new SetUniqueKey(cfMetaData, rowKey, columnKey, value);
            }
            else
            {
                // Case: set table.standard_cf['key'] = <column_map>;
                logger_.assertLog(dimensionCnt == 0, "invalid dimensionCnt: " + dimensionCnt);
                ColumnMapExpr columnMapExpr = getColumnMapExpr(valueNode);               
                plan = new SetColumnMap(cfMetaData, rowKey, columnMapExpr);
            }
        }
        return plan;
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.cql.common.ColumnMapExpr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.