MCPcopy Create free account
hub / github.com/apache/pig / LoadCaster

Interface LoadCaster

src/org/apache/pig/LoadCaster.java:40–145  ·  view source on GitHub ↗

An interface that provides cast implementations for load functions. For casts between bytearray objects and internal types, Pig relies on the load function that loaded the data to provide the cast. This is because Pig does not understand the binary representation of the data and thus cannot cast i

Source from the content-addressed store, hash-verified

38 * @since Pig 0.7
39 */
40@InterfaceAudience.Public
41@InterfaceStability.Evolving // Because we still don't have the map casts quite right
42public interface LoadCaster {
43
44 /**
45 * Cast data from bytearray to boolean value.
46 * @param b bytearray to be cast.
47 * @return Boolean value.
48 * @throws IOException if the value cannot be cast.
49 */
50 public Boolean bytesToBoolean(byte[] b) throws IOException;
51
52 /**
53 * Cast data from bytearray to long value.
54 * @param b bytearray to be cast.
55 * @return Long value.
56 * @throws IOException if the value cannot be cast.
57 */
58 public Long bytesToLong(byte[] b) throws IOException;
59
60 /**
61 * Cast data from bytearray to float value.
62 * @param b bytearray to be cast.
63 * @return Float value.
64 * @throws IOException if the value cannot be cast.
65 */
66 public Float bytesToFloat(byte[] b) throws IOException;
67
68 /**
69 * Cast data from bytearray to double value.
70 * @param b bytearray to be cast.
71 * @return Double value.
72 * @throws IOException if the value cannot be cast.
73 */
74 public Double bytesToDouble(byte[] b) throws IOException;
75
76 /**
77 * Cast data from bytearray to datetime value.
78 * @param b bytearray to be cast.
79 * @return datetime value.
80 * @throws IOException if the value cannot be cast.
81 */
82 public DateTime bytesToDateTime(byte[] b) throws IOException;
83
84 /**
85 * Cast data from bytearray to integer value.
86 * @param b bytearray to be cast.
87 * @return Double value.
88 * @throws IOException if the value cannot be cast.
89 */
90 public Integer bytesToInteger(byte[] b) throws IOException;
91
92 /**
93 * Cast data from bytearray to chararray value.
94 * @param b bytearray to be cast.
95 * @return String value.
96 * @throws IOException if the value cannot be cast.
97 */

Callers 87

testBooleanMethod · 0.65
testBooleanMethod · 0.65
testStoreComplexDataMethod · 0.65
testBytesToBooleanMethod · 0.65
bytesToBooleanMethod · 0.65
getNextBooleanMethod · 0.65
convertWithSchemaMethod · 0.65
testLongsMethod · 0.65
testLongMethod · 0.65
testStoreComplexDataMethod · 0.65

Implementers 7

TestLoadertest/org/apache/pig/test/TestPOCast.ja
Castertest/perf/pigmix/src/java/org/apache/p
TextLoadersrc/org/apache/pig/builtin/TextLoader.
UnImplementedLoadCastersrc/org/apache/pig/builtin/BinStorage.
AccumuloBinaryConvertersrc/org/apache/pig/backend/hadoop/accu
HBaseBinaryConvertersrc/org/apache/pig/backend/hadoop/hbas
Utf8StorageConvertersrc/org/apache/pig/builtin/Utf8Storage

Calls

no outgoing calls

Tested by

no test coverage detected