org.apache.pig.impl.util
Class CastUtils

java.lang.Object
  extended by org.apache.pig.impl.util.CastUtils

public class CastUtils
extends Object


Field Summary
protected static org.apache.commons.logging.Log mLog
           
 
Constructor Summary
CastUtils()
           
 
Method Summary
static Object convertToType(LoadCaster caster, byte[] bytes, ResourceSchema.ResourceFieldSchema fieldSchema, byte dataType)
           
static Boolean stringToBoolean(String str)
           
static Double stringToDouble(String str)
           
static Float stringToFloat(String str)
           
static Integer stringToInteger(String str)
           
static Long stringToLong(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mLog

protected static final org.apache.commons.logging.Log mLog
Constructor Detail

CastUtils

public CastUtils()
Method Detail

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)

stringToBoolean

public static Boolean stringToBoolean(String str)


Copyright © 2007-2012 The Apache Software Foundation