|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pig.builtin.Utf8StorageConverter
public class Utf8StorageConverter
This abstract class provides standard conversions between utf8 encoded data
and pig data types. It is intended to be extended by load and store
functions (such as PigStorage).
| Field Summary | |
|---|---|
protected BagFactory |
mBagFactory
|
protected org.apache.commons.logging.Log |
mLog
|
protected TupleFactory |
mTupleFactory
|
| Constructor Summary | |
|---|---|
Utf8StorageConverter()
|
|
| Method Summary | |
|---|---|
DataBag |
bytesToBag(byte[] b,
ResourceSchema.ResourceFieldSchema schema)
Cast data from bytearray to bag value. |
BigDecimal |
bytesToBigDecimal(byte[] b)
Cast data from bytearray to BigDecimal value. |
BigInteger |
bytesToBigInteger(byte[] b)
Cast data from bytearray to BigInteger value. |
Boolean |
bytesToBoolean(byte[] b)
Cast data from bytearray to boolean value. |
String |
bytesToCharArray(byte[] b)
Cast data from bytearray to chararray value. |
org.joda.time.DateTime |
bytesToDateTime(byte[] b)
Cast data from bytearray to datetime value. |
Double |
bytesToDouble(byte[] b)
Cast data from bytearray to double value. |
Float |
bytesToFloat(byte[] b)
Cast data from bytearray to float value. |
Integer |
bytesToInteger(byte[] b)
Cast data from bytearray to integer value. |
Long |
bytesToLong(byte[] b)
Cast data from bytearray to long value. |
Map<String,Object> |
bytesToMap(byte[] b,
ResourceSchema.ResourceFieldSchema fieldSchema)
Cast data from bytearray to map value. |
Tuple |
bytesToTuple(byte[] b,
ResourceSchema.ResourceFieldSchema fieldSchema)
Cast data from bytearray to tuple value. |
byte[] |
toBytes(BigDecimal bd)
|
byte[] |
toBytes(BigInteger bi)
|
byte[] |
toBytes(Boolean b)
|
byte[] |
toBytes(DataBag bag)
|
byte[] |
toBytes(DataByteArray a)
|
byte[] |
toBytes(org.joda.time.DateTime dt)
|
byte[] |
toBytes(Double d)
|
byte[] |
toBytes(Float f)
|
byte[] |
toBytes(Integer i)
|
byte[] |
toBytes(Long l)
|
byte[] |
toBytes(Map<String,Object> m)
|
byte[] |
toBytes(String s)
|
byte[] |
toBytes(Tuple t)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected BagFactory mBagFactory
protected TupleFactory mTupleFactory
protected final org.apache.commons.logging.Log mLog
| Constructor Detail |
|---|
public Utf8StorageConverter()
| Method Detail |
|---|
public DataBag bytesToBag(byte[] b,
ResourceSchema.ResourceFieldSchema schema)
throws IOException
LoadCaster
bytesToBag in interface LoadCasterb - bytearray to be cast.schema - field schema for the output bag
IOException - if the value cannot be cast.
public String bytesToCharArray(byte[] b)
throws IOException
LoadCaster
bytesToCharArray in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.public Double bytesToDouble(byte[] b)
LoadCaster
bytesToDouble in interface LoadCasterb - bytearray to be cast.
public Float bytesToFloat(byte[] b)
throws IOException
LoadCaster
bytesToFloat in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.
public Boolean bytesToBoolean(byte[] b)
throws IOException
LoadCaster
bytesToBoolean in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.
public Integer bytesToInteger(byte[] b)
throws IOException
LoadCaster
bytesToInteger in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.
public Long bytesToLong(byte[] b)
throws IOException
LoadCaster
bytesToLong in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.
public org.joda.time.DateTime bytesToDateTime(byte[] b)
throws IOException
LoadCaster
bytesToDateTime in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.
public Map<String,Object> bytesToMap(byte[] b,
ResourceSchema.ResourceFieldSchema fieldSchema)
throws IOException
LoadCaster
bytesToMap in interface LoadCasterb - bytearray to be cast.fieldSchema - field schema for the output map
IOException - if the value cannot be cast.
public Tuple bytesToTuple(byte[] b,
ResourceSchema.ResourceFieldSchema fieldSchema)
throws IOException
LoadCaster
bytesToTuple in interface LoadCasterb - bytearray to be cast.fieldSchema - field schema for the output tuple
IOException - if the value cannot be cast.
public BigInteger bytesToBigInteger(byte[] b)
throws IOException
LoadCaster
bytesToBigInteger in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.
public BigDecimal bytesToBigDecimal(byte[] b)
throws IOException
LoadCaster
bytesToBigDecimal in interface LoadCasterb - bytearray to be cast.
IOException - if the value cannot be cast.
public byte[] toBytes(DataBag bag)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(String s)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(Double d)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(Float f)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(Integer i)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(Long l)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(Boolean b)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(org.joda.time.DateTime dt)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(Map<String,Object> m)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(Tuple t)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(DataByteArray a)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(BigInteger bi)
throws IOException
toBytes in interface StoreCasterIOException
public byte[] toBytes(BigDecimal bd)
throws IOException
toBytes in interface StoreCasterIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||