Examples of VoltType


Examples of org.voltdb.VoltType

                // Column Stats
                if (query_type == QueryType.INSERT) {
                    if (this.target_columns.isEmpty()) {
                        for (Column catalog_col : catalog_tbl.getColumns()) {
                            VoltType col_type = VoltType.get((byte) catalog_col.getType());
                            if (TARGET_COLUMN_TYPES.contains(col_type)) {
                                String col_key = CatalogKey.createKey(catalog_col);
                                this.target_columns.add(this.column_stats.get(col_key));
                            }
                        } // FOR
View Full Code Here

Examples of org.voltdb.VoltType

                                break;
                            case RANGE: {
                                // Get the value type from the histogram
                                ObjectHistogram h = this.attribute_histograms.get(attr_key);
                                assert(h != null);
                                VoltType volt_type = h.getEstimatedType();
                                assert(volt_type != VoltType.INVALID);
                                val = VoltTypeUtil.getObjectFromString(volt_type, json_val);
                                break;
                            }
                            case STRING:
View Full Code Here

Examples of org.voltdb.VoltType

        // EE index key comparator can not cast keys to the RHS type.
        // Do not choose an index that requires such a cast.
        // Sadly, this restriction is not globally true but I don't
        // think the planner can really predict the index type that
        // the EE's index factory might construct.
        VoltType keyType = keyIsLeft ? expr.getLeft().getValueType()
                                     : expr.getRight().getValueType();

        VoltType exprType = keyIsLeft ? expr.getRight().getValueType()
                                      : expr.getLeft().getValueType();

        if (!VoltTypeUtil.isAllowableCastForKeyComparator(exprType, keyType))
        {
            return null;
View Full Code Here

Examples of org.voltdb.VoltType

     * @return
     */
    public static Object getValue(ParameterSet params, ParameterMapping pm) {
        Object val = null;
        Object orig = params.toArray()[pm.procedure_parameter.getIndex()];
        VoltType vtype = VoltType.get(pm.procedure_parameter.getType());
        if (pm.procedure_parameter.getIsarray()) {
            assert(pm.procedure_parameter_index != ParametersUtil.NULL_PROC_PARAMETER_OFFSET);
            switch (vtype) {
                case TINYINT: {
                    if (orig instanceof byte[])
View Full Code Here

Examples of org.voltdb.VoltType

            return (orig);

        Object cast_args[] = new Object[this.params.length];
        for (int i = 0; i < this.params.length; i++) {
            // Primitive Arrays! This is messed up in Java and why we're even here!
            VoltType vtype = this.param_types[i];
            if (this.param_isarray[i] && vtype != VoltType.STRING && vtype != VoltType.TIMESTAMP) {
                Object inner[] = null;
                try {
                    switch (this.param_types[i]) {
                        case TINYINT: {
View Full Code Here

Examples of org.voltdb.VoltType

     * @return
     */
    public static List<VoltType> getProcParameterTypes(final Procedure catalog_proc) {
        List<VoltType> vtypes = new ArrayList<VoltType>();
        for (ProcParameter catalog_param : CatalogUtil.getSortedCatalogItems(catalog_proc.getParameters(), "index")) {
            VoltType vtype = VoltType.get(catalog_param.getType());
            assert (vtype != null);
            assert (vtype != VoltType.INVALID);
            vtypes.add(vtype);
        } // FOR
        return (vtypes);
View Full Code Here

Examples of org.voltdb.VoltType

            for (ProcParameter param_cat : CatalogUtil.getSortedCatalogItems(catalog_proc.getParameters(), "index")) {
                DefaultMutableTreeNode param_node = new DefaultMutableTreeNode(new WrapperNode(param_cat) {
                    @Override
                    public String toString() {
                        ProcParameter param_cat = (ProcParameter)this.getCatalogType();
                        VoltType type = VoltType.get((byte)param_cat.getType());
                        return (super.toString() + " :: " + type.name());
                    }
                });
                parameters_node.add(param_node);
                buildSearchIndex(param_cat, param_node);
            } // FOR (parameters)
           
            // Statements
            if (catalog_proc.getSystemproc() == false) {
                DefaultMutableTreeNode statementRootNode = new CatalogMapTreeNode(Statement.class, "Statements", catalog_proc.getStatements());
                procNode.add(statementRootNode);                 
                for (Statement statement_cat : catalog_proc.getStatements()) {
                    DefaultMutableTreeNode statement_node = new DefaultMutableTreeNode(new WrapperNode(statement_cat));
                    statementRootNode.add(statement_node);
                    buildSearchIndex(statement_cat, statement_node);
                   
                    // Plan Trees
                    for (boolean is_singlepartition : new boolean[] { true, false }) {
                        if (is_singlepartition && !statement_cat.getHas_singlesited()) continue;
                        if (!is_singlepartition && !statement_cat.getHas_multisited()) continue;

                        String label = (is_singlepartition ? "Single-Partition" : "Distributed") + " Plan Fragments";
//                            String attributes = "";
                        AbstractPlanNode node = null;
                       
                        try {
                            node = PlanNodeUtil.getRootPlanNodeForStatement(statement_cat, is_singlepartition);
                        } catch (Exception e) {
                            String msg = e.getMessage();
                            if (msg == null || msg.length() == 0) {
                                e.printStackTrace();
                            } else {
                                LOG.warn(msg);
                            }
                        }
                       
                        CatalogMap<PlanFragment> fragments = (is_singlepartition ? statement_cat.getFragments() : statement_cat.getMs_fragments());
                        PlanTreeCatalogNode planTreeNode = new PlanTreeCatalogNode(label, fragments, node);
                        DefaultMutableTreeNode planNode = new DefaultMutableTreeNode(planTreeNode);
                        statement_node.add(planNode);
                       
                        // Plan Fragments
                        for (PlanFragment fragment_cat : CatalogUtil.getSortedCatalogItems(fragments, "id")) {
                            DefaultMutableTreeNode fragment_node = new DefaultMutableTreeNode(new WrapperNode(fragment_cat));
                            planNode.add(fragment_node);
                            buildSearchIndex(fragment_cat, fragment_node);
                        } // FOR (fragments)
                    }
               
                    // Statement Parameter
                    DefaultMutableTreeNode paramRootNode = new CatalogMapTreeNode(StmtParameter.class, "Parameters", statement_cat.getParameters());
                    statement_node.add(paramRootNode);
                    for (StmtParameter param_cat : CatalogUtil.getSortedCatalogItems(statement_cat.getParameters(), "index")) {
                        DefaultMutableTreeNode param_node = new DefaultMutableTreeNode(new WrapperNode(param_cat) {
                            @Override
                            public String toString() {
                                 StmtParameter param_cat = (StmtParameter)this.getCatalogType();
                                 VoltType type = VoltType.get((byte)param_cat.getJavatype());
                                 return (super.toString() + " :: " + type.name());
                            }
                        });
                        paramRootNode.add(param_node);
                        buildSearchIndex(param_cat, param_node);
                    } // FOR (parameters)
View Full Code Here

Examples of org.voltdb.VoltType

     * @return
     */
    protected Object[] randomStatementParameters(Statement catalog_stmt) {
        Object params[] = new Object[catalog_stmt.getParameters().size()];
        for (StmtParameter catalog_param : catalog_stmt.getParameters()) {
            VoltType vtype = VoltType.get(catalog_param.getJavatype());
            params[catalog_param.getIndex()] = VoltTypeUtil.getRandomValue(vtype);
            LOG.debug(catalog_param.fullName() + " -> " + params[catalog_param.getIndex()] + " / " + vtype);
        } // FOR
        return (params);
    }
View Full Code Here

Examples of org.voltdb.VoltType

    protected <T extends CatalogType> Pair<Object[], boolean[]> makeParams(List<T> catalog_params, String type_name) {
        Object params[] = new Object[catalog_params.size()];
        boolean is_array[] = new boolean[catalog_params.size()];
        int array_size = rand.nextInt(10);
        for (int i = 0; i < params.length; i++) {
            VoltType type = VoltType.get(((Integer)catalog_params.get(i).getField(type_name)).byteValue());
            //System.out.println(i + "[" + type_name + "-" + catalog_params.get(i).getField(type_name) + "]: " + type);
            Object param_is_array = catalog_params.get(i).getField("isarray");
            if (param_is_array != null && (Boolean)param_is_array) {
                is_array[i] = true;
                Object inner[] = new Object[array_size];
View Full Code Here

Examples of org.voltdb.VoltType

        };
        assertFalse(xact.hasOutput());
        xact.setOutput(output);
        assert(xact.hasOutput());
       
        VoltType expected[] = { VoltType.BIGINT, VoltType.BIGINT, VoltType.FLOAT };
        VoltType actual[] = xact.getOutputTypes(0);
        assertNotNull(actual);
        assertEquals(expected.length, actual.length);
        for (int i = 0; i < expected.length; i++) {
            assertEquals(Integer.toString(i), expected[i], actual[i]);
        } // FOR
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.