public static final SQLRowValues getGraphToFetch( Configuration conf, SQLTable table, List<SQLField> fieldsToFetch) { if (fieldsToFetch == null) return null; final SQLRowValues vals = new SQLRowValues(table); for (final SQLField f : fieldsToFetch) { vals.put(f.getName(), null); } // keep order field in graph (not only in graphToFetch) so that a debug column is created for (final Path orderP : Collections.singletonList(new Path(table))) { final SQLRowValues orderVals = vals.followPath(orderP); if (orderVals != null && orderVals.getTable().isOrdered()) { orderVals.put(orderVals.getTable().getOrderField().getName(), null); } } getShowAs(conf).expand(vals); return vals; }