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
| 38 | * @since Pig 0.7 |
| 39 | */ |
| 40 | @InterfaceAudience.Public |
| 41 | @InterfaceStability.Evolving // Because we still don't have the map casts quite right |
| 42 | public 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 | */ |
no outgoing calls
no test coverage detected