| 315 | } |
| 316 | |
| 317 | static String[][] MakeArray(Operator op, DataBag bag) |
| 318 | throws Exception { |
| 319 | int rows = (int) bag.size(); |
| 320 | int cols = ((LogicalRelationalOperator)op).getSchema().getFields().size(); |
| 321 | String[][] table = new String[rows][cols]; |
| 322 | Iterator<Tuple> it = bag.iterator(); |
| 323 | for (int i = 0; i < rows; ++i) { |
| 324 | Tuple t = it.next(); |
| 325 | for (int j = 0; j < cols; ++j) { |
| 326 | table[i][j] = ShortenField(t.get(j)); |
| 327 | } |
| 328 | } |
| 329 | return table; |
| 330 | } |
| 331 | |
| 332 | static String ShortenField(Object d) throws ExecException { |
| 333 | if (d instanceof Tuple) |