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

Method exec

src/org/apache/pig/builtin/ToString.java:41–53  ·  view source on GitHub ↗
(Tuple input)

Source from the content-addressed store, hash-verified

39public class ToString extends EvalFunc<String> {
40
41 public String exec(Tuple input) throws IOException {
42 if (input == null || input.size() < 1 || input.get(0) == null) {
43 return null;
44 }
45 if (input.size() == 1) {
46 return DataType.toDateTime(input.get(0)).toString();
47 } else if (input.size() == 2) {
48 DateTimeFormatter dtf = DateTimeFormat.forPattern(DataType.toString(input.get(1)));
49 return DataType.toDateTime(input.get(0)).toString(dtf);
50 } else {
51 return null;
52 }
53 }
54
55 @Override
56 public Schema outputSchema(Schema input) {

Calls 5

toDateTimeMethod · 0.95
toStringMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
toStringMethod · 0.45