Java Code Examples for org.apache.pig.data.DataType#BIGINTEGER

The following examples show how to use org.apache.pig.data.DataType#BIGINTEGER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: POPartialAgg.java    From spork with Apache License 2.0 6 votes vote down vote up
private Result getResult(ExpressionOperator op) throws ExecException {
    Result res;
    switch (op.getResultType()) {
    case DataType.BAG:
    case DataType.BOOLEAN:
    case DataType.BYTEARRAY:
    case DataType.CHARARRAY:
    case DataType.DOUBLE:
    case DataType.FLOAT:
    case DataType.INTEGER:
    case DataType.LONG:
    case DataType.BIGINTEGER:
    case DataType.BIGDECIMAL:
    case DataType.DATETIME:
    case DataType.MAP:
    case DataType.TUPLE:
        res = op.getNext(op.getResultType());
        break;
    default:
        String msg = "Invalid result type: "
                + DataType.findType(op.getResultType());
        throw new ExecException(msg, 2270, PigException.BUG);
    }

    return res;
}
 
Example 2
Source File: Divide.java    From spork with Apache License 2.0 6 votes vote down vote up
protected boolean equalsZero(Number a, byte dataType) throws ExecException {
    switch (dataType) {
    case DataType.DOUBLE:
        return ((Double) a).equals(0.0);
    case DataType.INTEGER:
        return ((Integer) a).equals(0);
    case DataType.LONG:
        return ((Long) a).equals(0L);
    case DataType.FLOAT:
        return ((Float) a).equals(0.0f);
    case DataType.BIGINTEGER:
        return BigInteger.ZERO.equals((BigInteger) a);
    case DataType.BIGDECIMAL:
        return BigDecimal.ZERO.equals((BigDecimal) a);
    default:
        throw new ExecException("Called on unsupported Number class " + DataType.findTypeName(dataType));
    }
}
 
Example 3
Source File: Divide.java    From spork with Apache License 2.0 6 votes vote down vote up
protected Number divide(Number a, Number b, byte dataType) throws ExecException {
    switch (dataType) {
    case DataType.DOUBLE:
        return Double.valueOf((Double) a / (Double) b);
    case DataType.INTEGER:
        return Integer.valueOf((Integer) a / (Integer) b);
    case DataType.LONG:
        return Long.valueOf((Long) a / (Long) b);
    case DataType.FLOAT:
        return Float.valueOf((Float) a / (Float) b);
    case DataType.BIGINTEGER:
        return ((BigInteger) a).divide((BigInteger) b);
    case DataType.BIGDECIMAL:
        return ((BigDecimal) a).divide((BigDecimal) b);
    default:
        throw new ExecException("called on unsupported Number class " + DataType.findTypeName(dataType));
    }
}
 
Example 4
Source File: Subtract.java    From spork with Apache License 2.0 6 votes vote down vote up
protected Number subtract(Number a, Number b, byte dataType) throws ExecException {
    switch(dataType) {
    case DataType.DOUBLE:
        return Double.valueOf((Double) a - (Double) b);
    case DataType.INTEGER:
        return Integer.valueOf((Integer) a - (Integer) b);
    case DataType.LONG:
        return Long.valueOf((Long) a - (Long) b);
    case DataType.FLOAT:
        return Float.valueOf((Float) a - (Float) b);
    case DataType.BIGINTEGER:
        return ((BigInteger) a).subtract((BigInteger) b);
    case DataType.BIGDECIMAL:
        return ((BigDecimal) a).subtract((BigDecimal) b);
    default:
        throw new ExecException("called on unsupported Number class " + DataType.findTypeName(dataType));
    }
}
 
Example 5
Source File: CastUtils.java    From spork with Apache License 2.0 6 votes vote down vote up
/**
 *
 * @param caster LoadCaster to be used to convert the bytes into a field.
 * @param bytes
 * @param fieldSchema schema of Bag or Tuple; pass in null if a simple type.
 * @param dataType type from DataType
 * @return converted object.
 * @throws IOException
 */
public static Object convertToType(LoadCaster caster, byte[] bytes,
        ResourceFieldSchema fieldSchema, byte dataType) throws IOException {
    switch (dataType) {
    case (DataType.BAG): return caster.bytesToBag(bytes, fieldSchema);
    case (DataType.BYTEARRAY): return new DataByteArray(bytes);
    case (DataType.CHARARRAY): return caster.bytesToCharArray(bytes);
    case (DataType.DOUBLE): return caster.bytesToDouble(bytes);
    case (DataType.FLOAT): return caster.bytesToFloat(bytes);
    case (DataType.INTEGER): return caster.bytesToInteger(bytes);
    case (DataType.BIGINTEGER): return caster.bytesToBigInteger(bytes);
    case (DataType.BIGDECIMAL): return caster.bytesToBigDecimal(bytes);
    case (DataType.LONG): return caster.bytesToLong(bytes);
    case (DataType.BOOLEAN): return caster.bytesToBoolean(bytes);
    case (DataType.DATETIME): return caster.bytesToDateTime(bytes);
    case (DataType.MAP): return caster.bytesToMap(bytes, fieldSchema);
    case (DataType.TUPLE): return caster.bytesToTuple(bytes, fieldSchema);
    default: throw new IOException("Unknown type " + dataType);
    }
}
 
Example 6
Source File: SchemaTupleClassGenerator.java    From spork with Apache License 2.0 6 votes vote down vote up
public String typeName(byte type) {
    switch(type) {
        case (DataType.INTEGER): return "int";
        case (DataType.LONG): return "long";
        case (DataType.FLOAT): return "float";
        case (DataType.DOUBLE): return "double";
        case (DataType.BYTEARRAY): return "byte[]";
        case (DataType.CHARARRAY): return "String";
        case (DataType.BOOLEAN): return "boolean";
        case (DataType.DATETIME): return "DateTime";
        case (DataType.BIGDECIMAL): return "BigDecimal";
        case (DataType.BIGINTEGER): return "BigInteger";
        case (DataType.TUPLE): return "Tuple";
        case (DataType.BAG): return "DataBag";
        case (DataType.MAP): return "Map";
        default: throw new RuntimeException("Can't return String for given type " + DataType.findTypeName(type));
    }
}
 
Example 7
Source File: SchemaTupleClassGenerator.java    From spork with Apache License 2.0 6 votes vote down vote up
@Override
public void process(int fieldPos, Schema.FieldSchema fs) {
    add("public "+typeName()+" getDummy_"+fieldPos+"() {");
    switch (fs.type) {
    case (DataType.INTEGER): add("    return 0;"); break;
    case (DataType.LONG): add("    return 0L;"); break;
    case (DataType.FLOAT): add("    return 0.0f;"); break;
    case (DataType.DOUBLE): add("    return 0.0;"); break;
    case (DataType.BOOLEAN): add("    return true;"); break;
    case (DataType.DATETIME): add("    return new DateTime();"); break;
    case (DataType.BIGDECIMAL): add("    return (BigDecimal)null;"); break;
    case (DataType.BIGINTEGER): add("    return (BigInteger)null;"); break;
    case (DataType.BYTEARRAY): add("    return (byte[])null;"); break;
    case (DataType.CHARARRAY): add("    return (String)null;"); break;
    case (DataType.TUPLE): add("    return (Tuple)null;"); break;
    case (DataType.BAG): add("    return (DataBag)null;"); break;
    case (DataType.MAP): add("    return (Map<String,Object>)null;"); break;
    default: throw new RuntimeException("Unsupported type");
    }
    add("}");
    addBreak();
}
 
Example 8
Source File: Multiply.java    From spork with Apache License 2.0 6 votes vote down vote up
protected Number multiply(Number a, Number b, byte dataType) throws ExecException {
    switch(dataType) {
    case DataType.DOUBLE:
        return Double.valueOf((Double) a * (Double) b);
    case DataType.INTEGER:
        return Integer.valueOf((Integer) a * (Integer) b);
    case DataType.LONG:
        return Long.valueOf((Long) a * (Long) b);
    case DataType.FLOAT:
        return Float.valueOf((Float) a * (Float) b);
    case DataType.BIGINTEGER:
        return ((BigInteger) a).multiply((BigInteger) b);
    case DataType.BIGDECIMAL:
        return ((BigDecimal) a).multiply((BigDecimal) b);
    default:
        throw new ExecException("called on unsupported Number class " + DataType.findTypeName(dataType));
    }
}
 
Example 9
Source File: HDataType.java    From spork with Apache License 2.0 5 votes vote down vote up
public static byte findTypeFromNullableWritable(PigNullableWritable o) throws ExecException {
    if (o instanceof NullableBooleanWritable)
        return DataType.BOOLEAN;
    else if (o instanceof NullableBytesWritable)
        return DataType.BYTEARRAY;
    else if (o instanceof NullableText)
        return DataType.CHARARRAY;
    else if (o instanceof NullableFloatWritable)
        return DataType.FLOAT;
    else if (o instanceof NullableDoubleWritable)
        return DataType.DOUBLE;
    else if (o instanceof NullableIntWritable)
        return DataType.INTEGER;
    else if (o instanceof NullableLongWritable)
        return DataType.LONG;
    else if (o instanceof NullableBigIntegerWritable)
        return DataType.BIGINTEGER;
    else if (o instanceof NullableBigDecimalWritable)
        return DataType.BIGDECIMAL;
    else if (o instanceof NullableDateTimeWritable)
        return DataType.DATETIME;
    else if (o instanceof NullableBag)
        return DataType.BAG;
    else if (o instanceof NullableTuple)
        return DataType.TUPLE;
    else {
        int errCode = 2044;
        String msg = "Cannot find Pig type for " + o.getClass().getName();
        throw new ExecException(msg, errCode, PigException.BUG);
    }
}
 
Example 10
Source File: PhysicalOperator.java    From spork with Apache License 2.0 5 votes vote down vote up
/**
 * Implementations that call into the different versions of getNext are often
 * identical, differing only in the signature of the getNext() call they make.
 * This method allows to cut down on some of the copy-and-paste.
 * @param dataType Describes the type of obj; a byte from DataType.
 *
 * @return result Result of applying this Operator to the Object.
 * @throws ExecException
 */
public Result getNext(byte dataType) throws ExecException {
    try {
        switch (dataType) {
        case DataType.BAG:
            return getNextDataBag();
        case DataType.BOOLEAN:
            return getNextBoolean();
        case DataType.BYTEARRAY:
            return getNextDataByteArray();
        case DataType.CHARARRAY:
            return getNextString();
        case DataType.DOUBLE:
            return getNextDouble();
        case DataType.FLOAT:
            return getNextFloat();
        case DataType.INTEGER:
            return getNextInteger();
        case DataType.LONG:
            return getNextLong();
        case DataType.BIGINTEGER:
            return getNextBigInteger();
        case DataType.BIGDECIMAL:
            return getNextBigDecimal();
        case DataType.DATETIME:
            return getNextDateTime();
        case DataType.MAP:
            return getNextMap();
        case DataType.TUPLE:
            return getNextTuple();
        default:
            throw new ExecException("Unsupported type for getNext: " + DataType.findTypeName(dataType));
        }
    } catch (RuntimeException e) {
        throw new ExecException("Exception while executing " + this.toString() + ": " + e.toString(), e);
    }
}
 
Example 11
Source File: GTOrEqualToExpr.java    From spork with Apache License 2.0 5 votes vote down vote up
@Override
public Result getNextBoolean() throws ExecException {
    Result left, right;

    switch (operandType) {
    case DataType.BYTEARRAY:
    case DataType.DOUBLE:
    case DataType.FLOAT:
    case DataType.INTEGER:
    case DataType.LONG:
    case DataType.BIGINTEGER:
    case DataType.BIGDECIMAL:
    case DataType.DATETIME:
    case DataType.CHARARRAY: {
        Result r = accumChild(null, operandType);
        if (r != null) {
            return r;
        }
        left = lhs.getNext(operandType);
        right = rhs.getNext(operandType);
        return doComparison(left, right);
    }

    default: {
        int errCode = 2067;
        String msg = this.getClass().getSimpleName() + " does not know how to " +
        "handle type: " + DataType.findTypeName(operandType);
        throw new ExecException(msg, errCode, PigException.BUG);
    }

    }
}
 
Example 12
Source File: AugmentBaseDataVisitor.java    From spork with Apache License 2.0 5 votes vote down vote up
Object generateData(byte type, String data) {
    switch (type) {
    case DataType.BOOLEAN:
        if (data.equalsIgnoreCase("true")) {
            return Boolean.TRUE;
        } else if (data.equalsIgnoreCase("false")) {
            return Boolean.FALSE;
        } else {
            return null;
        }
    case DataType.BYTEARRAY:
        return new DataByteArray(data.getBytes());
    case DataType.DOUBLE:
        return Double.valueOf(data);
    case DataType.FLOAT:
        return Float.valueOf(data);
    case DataType.INTEGER:
        return Integer.valueOf(data);
    case DataType.LONG:
        return Long.valueOf(data);
    case DataType.BIGINTEGER:
        return new BigInteger(data);
    case DataType.BIGDECIMAL:
        return new BigDecimal(data);
    case DataType.DATETIME:
        return new DateTime(data);
    case DataType.CHARARRAY:
        return data;
    default:
        return null;
    }
}
 
Example 13
Source File: SchemaTupleClassGenerator.java    From spork with Apache License 2.0 4 votes vote down vote up
public boolean isBigInteger() {
    return type == DataType.BIGINTEGER;
}
 
Example 14
Source File: AlgebraicBigIntegerMathBase.java    From spork with Apache License 2.0 4 votes vote down vote up
@Override
public Schema outputSchema(Schema input) {
    return new Schema(new Schema.FieldSchema(null, DataType.BIGINTEGER));
}
 
Example 15
Source File: TezDagBuilder.java    From spork with Apache License 2.0 4 votes vote down vote up
private static Class<? extends WritableComparator> comparatorForKeyType(byte keyType, boolean hasOrderBy)
        throws JobCreationException {

    switch (keyType) {
    case DataType.BOOLEAN:
        return PigBooleanRawComparator.class;

    case DataType.INTEGER:
        return PigIntRawComparator.class;

    case DataType.BIGINTEGER:
        return PigBigIntegerRawComparator.class;

    case DataType.BIGDECIMAL:
        return PigBigDecimalRawComparator.class;

    case DataType.LONG:
        return PigLongRawComparator.class;

    case DataType.FLOAT:
        return PigFloatRawComparator.class;

    case DataType.DOUBLE:
        return PigDoubleRawComparator.class;

    case DataType.DATETIME:
        return PigDateTimeRawComparator.class;

    case DataType.CHARARRAY:
        return PigTextRawComparator.class;

    case DataType.BYTEARRAY:
        //if (hasOrderBy) {
            return PigBytesRawComparator.class;
        //} else {
        //    return PigDBAWritableComparator.class;
        //}

    case DataType.MAP:
        int errCode = 1068;
        String msg = "Using Map as key not supported.";
        throw new JobCreationException(msg, errCode, PigException.INPUT);

    case DataType.TUPLE:
        //TODO: PigTupleWritableComparator gives wrong results with cogroup in
        //Checkin_2 and few other e2e tests. But MR has PigTupleWritableComparator
        //Investigate the difference later
        //if (hasOrderBy) {
            return PigTupleSortComparator.class;
        //} else {
        //    return PigTupleWritableComparator.class;
        //}

    case DataType.BAG:
        errCode = 1068;
        msg = "Using Bag as key not supported.";
        throw new JobCreationException(msg, errCode, PigException.INPUT);

    default:
        errCode = 2036;
        msg = "Unhandled key type " + DataType.findTypeName(keyType);
        throw new JobCreationException(msg, errCode, PigException.BUG);
    }
}
 
Example 16
Source File: TestPackage.java    From spork with Apache License 2.0 4 votes vote down vote up
/**
 * To show that it does not have any type specific
 * code
 */
private void pickTest(byte t, boolean[] inner) throws ExecException, IOException {
    Random r = new Random();
    switch (t) {
    case DataType.BAG:
        runTest(GenRandomData.genRandSmallTupDataBag(r, 10, 100), inner, DataType.BAG);
        break;
    case DataType.BOOLEAN:
        runTest(r.nextBoolean(), inner, DataType.BOOLEAN);
        break;
    case DataType.BYTEARRAY:
        runTest(GenRandomData.genRandDBA(r), inner, DataType.BYTEARRAY);
        break;
    case DataType.BIGCHARARRAY: {
        String s = GenRandomData.genRandString(r);
        for (; s.length() < 65535;) {
            s += GenRandomData.genRandString(r);
        }
        runTest(s, inner, DataType.CHARARRAY);
        break;
    }
    case DataType.CHARARRAY:
        runTest(GenRandomData.genRandString(r), inner, DataType.CHARARRAY);
        break;
    case DataType.DOUBLE:
        runTest(r.nextDouble(), inner, DataType.DOUBLE);
        break;
    case DataType.FLOAT:
        runTest(r.nextFloat(), inner, DataType.FLOAT);
        break;
    case DataType.INTEGER:
        runTest(r.nextInt(), inner, DataType.INTEGER);
        break;
    case DataType.LONG:
        runTest(r.nextLong(), inner, DataType.LONG);
        break;
    case DataType.DATETIME:
        runTest(new DateTime(r.nextLong()), inner, DataType.DATETIME);
        break;
    case DataType.MAP:
    case DataType.INTERNALMAP:
    case DataType.BYTE:
        return; // map not key type
    case DataType.TUPLE:
        runTest(GenRandomData.genRandSmallBagTuple(r, 10, 100), inner, DataType.TUPLE);
        break;
    case DataType.BIGINTEGER:
        runTest(new BigInteger(256, r), inner, DataType.BIGINTEGER);
        break;
    case DataType.BIGDECIMAL:
        runTest(new BigDecimal(r.nextDouble()), inner, DataType.BIGDECIMAL);
        break;
    default:
        fail("No test case for type " + DataType.findTypeName(t));
    }
}
 
Example 17
Source File: AugmentBaseDataVisitor.java    From spork with Apache License 2.0 4 votes vote down vote up
Object GetSmallerValue(Object v) {
    byte type = DataType.findType(v);

    if (type == DataType.BAG || type == DataType.TUPLE
            || type == DataType.MAP)
        return null;

    switch (type) {
    case DataType.CHARARRAY:
        String str = (String) v;
        if (str.length() > 0)
            return str.substring(0, str.length() - 1);
        else
            return null;
    case DataType.BYTEARRAY:
        DataByteArray data = (DataByteArray) v;
        if (data.size() > 0)
            return new DataByteArray(data.get(), 0, data.size() - 1);
        else
            return null;
    case DataType.INTEGER:
        return Integer.valueOf((Integer) v - 1);
    case DataType.LONG:
        return Long.valueOf((Long) v - 1);
    case DataType.FLOAT:
        return Float.valueOf((Float) v - 1);
    case DataType.DOUBLE:
        return Double.valueOf((Double) v - 1);
    case DataType.BIGINTEGER:
        return ((BigInteger)v).subtract(BigInteger.ONE);
    case DataType.BIGDECIMAL:
        return ((BigDecimal)v).subtract(BigDecimal.ONE);
    case DataType.DATETIME:
        DateTime dt = (DateTime) v;
        if (dt.getMillisOfSecond() != 0) {
            return dt.minusMillis(1);
        } else if (dt.getSecondOfMinute() != 0) {
            return dt.minusSeconds(1);
        } else if (dt.getMinuteOfHour() != 0) {
            return dt.minusMinutes(1);
        } else if (dt.getHourOfDay() != 0) {
            return dt.minusHours(1);
        } else {
            return dt.minusDays(1);
        }
    default:
        return null;
    }

}
 
Example 18
Source File: POPreCombinerLocalRearrange.java    From spork with Apache License 2.0 4 votes vote down vote up
/**
 * Calls getNext on the generate operator inside the nested
 * physical plan. Converts the generated tuple into the proper
 * format, i.e, (key,indexedTuple(value))
 */
@Override
public Result getNextTuple() throws ExecException {

    Result inp = null;
    Result res = ERR_RESULT;
    while (true) {
        inp = processInput();
        if (inp.returnStatus == POStatus.STATUS_EOP || inp.returnStatus == POStatus.STATUS_ERR) {
            break;
        }
        if (inp.returnStatus == POStatus.STATUS_NULL) {
            continue;
        }

        for (PhysicalPlan ep : plans) {
            ep.attachInput((Tuple)inp.result);
        }
        List<Result> resLst = new ArrayList<Result>();
        for (ExpressionOperator op : leafOps){

            switch(op.getResultType()){
            case DataType.BAG:
            case DataType.BOOLEAN:
            case DataType.BYTEARRAY:
            case DataType.CHARARRAY:
            case DataType.DOUBLE:
            case DataType.FLOAT:
            case DataType.INTEGER:
            case DataType.LONG:
            case DataType.BIGINTEGER:
            case DataType.BIGDECIMAL:
            case DataType.DATETIME:
            case DataType.MAP:
            case DataType.TUPLE:
                res = op.getNext(op.getResultType());
                break;
            default:
                log.error("Invalid result type: "
                        + DataType.findType(op.getResultType()));
                break;
            }

            if (res.returnStatus != POStatus.STATUS_OK) {
                return res;
            }

            resLst.add(res);
        }
        res.result = constructLROutput(resLst,(Tuple)inp.result);
        res.returnStatus = POStatus.STATUS_OK;

        return res;
    }
    return inp;
}
 
Example 19
Source File: TypeCheckingExpVisitor.java    From spork with Apache License 2.0 4 votes vote down vote up
/***
 * Helper for collecting warning when casting is inserted
 * to the plan (implicit casting)
 *
 * @param node
 * @param originalType
 * @param toType
 */
static void collectCastWarning(Operator node,
        byte originalType,
        byte toType,
        CompilationMessageCollector msgCollector
) {
    String originalTypeName = DataType.findTypeName(originalType) ;
    String toTypeName = DataType.findTypeName(toType) ;
    String opName= node.getClass().getSimpleName() ;
    PigWarning kind = null;
    switch(toType) {
    case DataType.BAG:
        kind = PigWarning.IMPLICIT_CAST_TO_BAG;
        break;
    case DataType.CHARARRAY:
        kind = PigWarning.IMPLICIT_CAST_TO_CHARARRAY;
        break;
    case DataType.DOUBLE:
        kind = PigWarning.IMPLICIT_CAST_TO_DOUBLE;
        break;
    case DataType.FLOAT:
        kind = PigWarning.IMPLICIT_CAST_TO_FLOAT;
        break;
    case DataType.INTEGER:
        kind = PigWarning.IMPLICIT_CAST_TO_INT;
        break;
    case DataType.LONG:
        kind = PigWarning.IMPLICIT_CAST_TO_LONG;
        break;
    case DataType.BOOLEAN:
        kind = PigWarning.IMPLICIT_CAST_TO_BOOLEAN;
        break;
    case DataType.DATETIME:
        kind = PigWarning.IMPLICIT_CAST_TO_DATETIME;
        break;
    case DataType.MAP:
        kind = PigWarning.IMPLICIT_CAST_TO_MAP;
        break;
    case DataType.TUPLE:
        kind = PigWarning.IMPLICIT_CAST_TO_TUPLE;
        break;
    case DataType.BIGINTEGER:
        kind = PigWarning.IMPLICIT_CAST_TO_BIGINTEGER;
        break;
    case DataType.BIGDECIMAL:
        kind = PigWarning.IMPLICIT_CAST_TO_BIGDECIMAL;
        break;
    }
    msgCollector.collect(originalTypeName + " is implicitly cast to "
            + toTypeName +" under " + opName + " Operator",
            MessageType.Warning, kind) ;
}
 
Example 20
Source File: TypeUtil.java    From phoenix with Apache License 2.0 4 votes vote down vote up
/**
 * This method returns the most appropriate PDataType associated with 
 * the incoming Pig type. Note for Pig DataType DATETIME, returns DATE as 
 * inferredSqlType. 
 * 
 * This is later used to make a cast to targetPhoenixType accordingly. See
 * {@link #castPigTypeToPhoenix(Object, byte, PDataType)}
 * 
 * @param obj
 * @return PDataType
 */
public static PDataType getType(Object obj, byte type) {
	if (obj == null) {
		return null;
	}
	PDataType sqlType;

	switch (type) {
	case DataType.BYTEARRAY:
		sqlType = PVarbinary.INSTANCE;
		break;
	case DataType.CHARARRAY:
		sqlType = PVarchar.INSTANCE;
		break;
	case DataType.DOUBLE:
	case DataType.BIGDECIMAL:
		sqlType = PDouble.INSTANCE;
		break;
	case DataType.FLOAT:
		sqlType = PFloat.INSTANCE;
		break;
	case DataType.INTEGER:
		sqlType = PInteger.INSTANCE;
		break;
	case DataType.LONG:
	case DataType.BIGINTEGER:
		sqlType = PLong.INSTANCE;
		break;
	case DataType.BOOLEAN:
		sqlType = PBoolean.INSTANCE;
		break;
	case DataType.DATETIME:
		sqlType = PDate.INSTANCE;
		break;
	case DataType.BYTE:
		sqlType = PTinyint.INSTANCE;
		break;
	default:
		throw new RuntimeException("Unknown type " + obj.getClass().getName()
				+ " passed to PhoenixHBaseStorage");
	}

	return sqlType;

}