Examples of VoltType


Examples of org.voltdb.VoltType

        }

        @Override
        public <T> Object evaluate(T tuple) {
            VoltTable row = (VoltTable) tuple;
            VoltType type = row.getColumnType(row.getColumnIndex(m_name));
            return row.get(m_name, type);
        }
View Full Code Here

Examples of org.voltdb.VoltType

        @SuppressWarnings("unchecked")
        private static <T> void getKey(VoltTable tuple, String columnName,
                                       Set<T> keySet) {
            final int index = tuple.getColumnIndex(columnName);
            final VoltType type = tuple.getColumnType(index);
            keySet.add((T) tuple.get(index, type));
        }
View Full Code Here

Examples of org.voltdb.VoltType

        private static <T> void getKeys(VoltTable tuple, String[] columnNames,
                                        Set<List<Number>> keySet) {
            final List<Number> key = new ArrayList<Number>(columnNames.length);
            for (String name : columnNames) {
                final int index = tuple.getColumnIndex(name);
                final VoltType type = tuple.getColumnType(index);
                key.add((Number) tuple.get(index, type));
            }
            keySet.add(key);
        }
View Full Code Here

Examples of org.voltdb.VoltType

     * @return
     */
    public static Object[] getRandomRow(VoltTable volt_tbl) {
        Object row[] = new Object[volt_tbl.getColumnCount()];
        for (int i = 0; i < row.length; i++) {
            VoltType vtype = volt_tbl.getColumnType(i);
            row[i] = VoltTypeUtil.getRandomValue(vtype);
            // HACK: We don't actually now the VARCHAR length here,
            // so we'll just leave it at 8
            if (vtype == VoltType.STRING) {
                row[i] = StringUtil.abbrv(row[i].toString(), 8, false);
View Full Code Here

Examples of org.voltdb.VoltType

     */
    public static Object[] getRandomRow(Table catalog_tbl) {
        Object row[] = new Object[catalog_tbl.getColumns().size()];
        for (Column catalog_col : catalog_tbl.getColumns()) {
            int i = catalog_col.getIndex();
            VoltType vtype = VoltType.get(catalog_col.getType());
            row[i] = VoltTypeUtil.getRandomValue(vtype);
            if (vtype == VoltType.STRING) {
                row[i] = StringUtil.abbrv(row[i].toString(), catalog_col.getSize(), false);
            }
        } // FOR
View Full Code Here

Examples of org.voltdb.VoltType

            for (int i = 0; i < this.output.length; i++) {
                stringer.object();
               
                // COLUMN TYPES
                stringer.key("TYPES").array();
                VoltType types[] = this.output_types[i];
                if (types != null) {
                    for (int j = 0; j < types.length; j++) {
                        stringer.value((types[j] == null ? VoltType.NULL : types[j]).name());
                    } // FOR
                }
View Full Code Here

Examples of org.voltdb.VoltType

                this.params[i] = null;
                continue;
            }
           
            U catalog_param = catalog_params.get(i);
            VoltType param_type = VoltType.get(((Integer)catalog_param.getField(param_field)).byteValue());
            // if (param_type == VoltType.TINYINT) param_type = VoltType.INTEGER;
            if (param_type == null) {
                throw new Exception("Parameter type is null for " + catalog_param);
            }
            // We don't know whether we have a StmtParameter or a ProcParameter
View Full Code Here

Examples of org.voltdb.VoltType

        String ret = "CREATE TABLE " + catalog_tbl.getTypeName() + " (";

        // Columns
        String add = "\n";
        for (Column catalog_col : CatalogUtil.getSortedCatalogItems(catalog_tbl.getColumns(), "index")) {
            VoltType col_type = VoltType.get((byte)catalog_col.getType());

            // this next assert would be great if we dealt with default values well
            //assert(! ((catalog_col.getDefaultvalue() == null) && (catalog_col.getNullable() == false) ) );

            ret += add + spacer + catalog_col.getTypeName() + " " +
                   col_type.toSQLString() +
                   (col_type == VoltType.STRING && catalog_col.getSize() > 0 ? "(" + catalog_col.getSize() + ")" : "");

            // Default value
            String defaultValue = catalog_col.getDefaultvalue();
//            VoltType defaultType = VoltType.get(catalog_col.getDefaulttype());
View Full Code Here

Examples of org.voltdb.VoltType

        if (target_params != null) {
            AbstractHasher hasher = p_estimator.getHasher();
            boolean first = true;
            for (CatalogType catalog_param : target_params) {
                // Skip types that are always unique (and not useful for partitioning)
                VoltType vtype = VoltType.get((catalog_param instanceof StmtParameter ? ((StmtParameter)catalog_param).getJavatype() :
                                                                                        ((ProcParameter)catalog_param).getType()));
                if (vtype == VoltType.STRING || vtype == VoltType.TIMESTAMP) continue;
               
                // Add a prefix to separate parameters
                if (first == false) sig += "|";
View Full Code Here

Examples of org.voltdb.VoltType

        //            Example: FLOAT + INTEGER -> FLOAT
        //    (4) Specific types for floating-point and integer types take precedence
        //        over the more general types
        //            Example: MONEY + FLOAT -> MONEY
        //            Example: TIMESTAMP + INTEGER -> TIMESTAMP
        VoltType cast_order[] = { VoltType.STRING,
                                  VoltType.DECIMAL,
                                  VoltType.FLOAT,
                                  VoltType.TIMESTAMP,
                                  VoltType.BIGINT };
        for (VoltType cast_type : cast_order) {
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.