Examples of ParameterValueExpression


Examples of org.voltdb.expressions.ParameterValueExpression

                ConstantValueExpression in_const_exp = (ConstantValueExpression)in_exp;
                assertEquals(out_const_exp.getValue(), in_const_exp.getValue());
                break;
            }
            case VALUE_PARAMETER:
                ParameterValueExpression out_param_exp = (ParameterValueExpression)out_exp;
                ParameterValueExpression in_param_exp = (ParameterValueExpression)in_exp;
                assertEquals(out_param_exp.getParameterId(), in_param_exp.getParameterId());
                break;
            case VALUE_TUPLE:
                TupleValueExpression out_tuple_exp = (TupleValueExpression)out_exp;
                TupleValueExpression in_tuple_exp = (TupleValueExpression)in_exp;
                assertEquals(out_tuple_exp.getColumnIndex(), in_tuple_exp.getColumnIndex());
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

        final List<AbstractExpression> combine_exps = new ArrayList<AbstractExpression>();
        final Map<AbstractExpression, AbstractExpression> combine_exps_left = new HashMap<AbstractExpression, AbstractExpression>();
        final Map<AbstractExpression, AbstractExpression> combine_exps_right = new HashMap<AbstractExpression, AbstractExpression>();
        for (int ctr = 0; ctr < num_of_subtrees; ctr++) {
            AbstractExpression exps[] = { new ComparisonExpression(ExpressionType.COMPARE_EQUAL),
                                          new ParameterValueExpression(),
                                          new TupleValueExpression()
            };
            exps[0].setLeft(exps[1]);
            exps[0].setRight(exps[2]);
            //ExpressionUtil.generateIds(exps[0]);
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

        assert(vt != VoltType.VOLTTABLE);
        if (vt != VoltType.STRING) {
            size = vt.getLengthInBytesForFixedTypes();
        }
        if ((isParam != null) && (isParam.getNodeValue().equalsIgnoreCase("true"))) {
            ParameterValueExpression expr = new ParameterValueExpression();
            long id = Long.parseLong(attrs.getNamedItem("id").getNodeValue());
            ParameterInfo param = paramsById.get(id);

            expr.setValueType(vt);
            expr.setValueSize(size);
            expr.setParameterId(param.index);

            return expr;
        }
        else {
            ConstantValueExpression expr = new ConstantValueExpression();
            expr.setValueType(vt);
            expr.setValueSize(size);
            expr.setValue(attrs.getNamedItem("value").getNodeValue());
            return expr;
        }
    }
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

                                               "tuple_address",
                                               col1_exp));
        cols[0] = "tuple_address";

        // update column 1 with a parameter value
        ParameterValueExpression col2_exp = new ParameterValueExpression();
        col2_exp.setParameterIndex(0);
        col2_exp.setValueType(COLTYPES[1]);
        col2_exp.setValueSize(COLTYPES[1].getLengthInBytesForFixedTypes());
        // XXX I'm not sure what to do with the name for the updated column yet.
        // I think it should be an alias and not the original table name/col name
        proj_schema.addColumn(new SchemaColumn(TABLE1, TABLE1, COLS[1], COLS[1],
                                               col2_exp));
        cols[1] = COLS[1];
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

        // Input Parameters
        // We will need to update the system catalogs with this new information
        for (int i = 0; i < plan.parameters.length; ++i) {
            StmtParameter catalogParam = catalogStmt.getParameters().add(String.valueOf(i));
            ParameterValueExpression pve = plan.parameters[i];
            catalogParam.setJavatype(pve.getValueType().getValue());
            catalogParam.setIsarray(pve.getParamIsVector());
            catalogParam.setIndex(i);
        }

        List<PlanNodeList> nodeLists = new ArrayList<PlanNodeList>();
        nodeLists.add(new PlanNodeList(plan.rootPlanGraph));
        if (plan.subPlanGraph != null) {
            nodeLists.add(new PlanNodeList(plan.subPlanGraph));
        }

        //Store the list of parameters types and indexes in the plan node list.
        List<Pair<Integer, VoltType>> parameters = nodeLists.get(0).getParameters();
        for (int i = 0; i < plan.parameters.length; ++i) {
            ParameterValueExpression pve = plan.parameters[i];
            Pair<Integer, VoltType> parameter = new Pair<Integer, VoltType>(i, pve.getValueType());
            parameters.add(parameter);
        }

        // Now update our catalog information
        // HACK: We're using the node_tree's hashCode() as it's name. It would be really
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

        if (m_fullColumnName == null) {
            m_fullColumnName = fullColumnName;
        }
        m_inferredExpression.add(constExpr);
        if (constExpr instanceof ParameterValueExpression) {
            ParameterValueExpression pve = (ParameterValueExpression)constExpr;
            m_inferredParameterIndex = pve.getParameterIndex();
        } else {
            m_inferredValue = ConstantValueExpression.extractPartitioningValue(valueType, constExpr);
        }
    }
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

    // A reusable step extracted from boundParamIndexes so it can be applied to two different
    // sources of bindings, IndexScans and IndexCounts.
    private static void setParamIndexes(BitSet ints, List<AbstractExpression> params) {
        for(AbstractExpression ae : params) {
            assert(ae instanceof ParameterValueExpression);
            ParameterValueExpression pve = (ParameterValueExpression) ae;
            int param = pve.getParameterIndex();
            ints.set(param);
        }
    }
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

    private int parameterCountIndexById(long paramId) {
        if (paramId == -1) {
            return -1;
        }
        assert(m_paramsById.containsKey(paramId));
        ParameterValueExpression pve = m_paramsById.get(paramId);
        // As a side effect, re-establish these parameters as integer-typed
        // -- this helps to catch type errors earlier in the invocation process
        // and prevents a more serious error in HSQLBackend statement reconstruction.
        // The HSQL parser originally had these correctly pegged as BIGINTs,
        // but the VoltDB code ( @see AbstractParsedStmt#parseParameters )
        // skeptically second-guesses that pending its own verification. This case is now verified.
        pve.refineValueType(VoltType.BIGINT, VoltType.BIGINT.getLengthInBytesForFixedTypes());
        return pve.getParameterIndex();
    }
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

            }
        }

        if (needParameter) {
            long id = Long.parseLong(exprNode.attributes.get("id"));
            ParameterValueExpression expr = m_paramsById.get(id);
            assert(expr != null);
            if (needConstant) {
                expr.setOriginalValue(cve);
                cve.setValue(m_paramValues[expr.getParameterIndex()]);
            }
            return expr;
        }
        return cve;
    }
View Full Code Here

Examples of org.voltdb.expressions.ParameterValueExpression

                long id = Long.parseLong(node.attributes.get("id"));
                int index = Integer.parseInt(node.attributes.get("index"));
                String typeName = node.attributes.get("valuetype");
                String isVectorParam = node.attributes.get("isvector");
                VoltType type = VoltType.typeFromString(typeName);
                ParameterValueExpression pve = new ParameterValueExpression();
                pve.setParameterIndex(index);
                pve.setValueType(type);
                if (isVectorParam != null && isVectorParam.equalsIgnoreCase("true")) {
                    pve.setParamIsVector();
                }
                m_paramsById.put(id, pve);
                m_paramList[index] = pve;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.