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

Method convertBagToSortedBag

test/org/apache/pig/test/Util.java:1222–1246  ·  view source on GitHub ↗
(Tuple t)

Source from the content-addressed store, hash-verified

1220
1221
1222 static public void convertBagToSortedBag(Tuple t) {
1223 for (int i=0;i<t.size();i++) {
1224 Object obj = null;
1225 try {
1226 obj = t.get(i);
1227 } catch (ExecException e) {
1228 // shall not happen
1229 }
1230 if (obj instanceof DataBag) {
1231 DataBag bag = (DataBag)obj;
1232 Iterator<Tuple> iter = bag.iterator();
1233 DataBag sortedBag = DefaultBagFactory.getInstance().newSortedBag(null);
1234 while (iter.hasNext()) {
1235 Tuple t2 = iter.next();
1236 sortedBag.add(t2);
1237 convertBagToSortedBag(t2);
1238 }
1239 try {
1240 t.set(i, sortedBag);
1241 } catch (ExecException e) {
1242 // shall not happen
1243 }
1244 }
1245 }
1246 }
1247
1248 static public void checkQueryOutputsAfterSortRecursive(Iterator<Tuple> actualResultsIt,
1249 String[] expectedResArray, String schemaString) throws IOException {

Callers 4

testMultiSplitsMethod · 0.95
checkQueryOutputsMethod · 0.95

Calls 9

iteratorMethod · 0.95
addMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
setMethod · 0.65
newSortedBagMethod · 0.45
getInstanceMethod · 0.45
hasNextMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected