/** * Initializes the reduce-part of the job with the appropriate output settings * * @param job The job * @param tableName The table to insert data into * @param fieldNames The field names in the table. */ public static void setOutput(JobConf job, String tableName, String... fieldNames) { if (fieldNames.length > 0 && fieldNames[0] != null) { DBConfiguration dbConf = setOutput(job, tableName); dbConf.setOutputFieldNames(fieldNames); } else { if (fieldNames.length > 0) setOutput(job, tableName, fieldNames.length); else throw new IllegalArgumentException("Field names must be greater than 0"); } }