org.apache.pig.impl.util
Class CastUtils
java.lang.Object
org.apache.pig.impl.util.CastUtils
public class CastUtils
- extends Object
Field Summary |
protected static org.apache.commons.logging.Log |
mLog
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mLog
protected static final org.apache.commons.logging.Log mLog
CastUtils
public CastUtils()
convertToType
public static Object convertToType(LoadCaster caster,
byte[] bytes,
ResourceSchema.ResourceFieldSchema fieldSchema,
byte dataType)
throws IOException
- Parameters:
caster
- LoadCaster to be used to convert the bytes into a field.bytes
- fieldSchema
- schema of Bag or Tuple; pass in null if a simple type.dataType
- type from DataType
- Returns:
- converted object.
- Throws:
IOException
stringToDouble
public static Double stringToDouble(String str)
stringToFloat
public static Float stringToFloat(String str)
stringToInteger
public static Integer stringToInteger(String str)
stringToLong
public static Long stringToLong(String str)
Copyright © 2012 The Apache Software Foundation