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

Method toDelimitedString

test/org/apache/pig/test/TestStore.java:213–233  ·  view source on GitHub ↗
(Tuple t, String delim)

Source from the content-addressed store, hash-verified

211 }
212
213 @SuppressWarnings("unchecked")
214 private String toDelimitedString(Tuple t, String delim) throws ExecException {
215 StringBuilder buf = new StringBuilder();
216 for (int i = 0; i < t.size(); i++) {
217 Object field = t.get(i);
218 if(field == null) {
219 buf.append("");
220 } else {
221 if(field instanceof Map) {
222 Map<String, Object> m = (Map<String, Object>)field;
223 buf.append(DataType.mapToString(m));
224 } else {
225 buf.append(field.toString());
226 }
227 }
228
229 if (i != t.size() - 1)
230 buf.append(delim);
231 }
232 return buf.toString();
233 }
234
235 @Test
236 public void testStoreComplexData() throws Exception {

Callers 1

Calls 5

mapToStringMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
appendMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected