@Override public void initialize(BatchRuntimeContext context) throws Exception { schema = config.getSchema(); // should never happen, just done to test App correctness in unit tests if (context.getOutputSchema() != null && !schema.equals(context.getOutputSchema())) { throw new IllegalStateException("Output schema does not match what was set at configure time."); } }
KeyValueTable processedFileMemoryTable = batchRuntimeContext.getDataset(excelInputreaderConfig.memoryTableName); processedFileMemoryTable.write(Bytes.toBytes(fileName), Bytes.toBytes(new Date().getTime())); errorRecordBuilder.set(SHEET, sheetName); errorRecordBuilder.set(RECORD, inputValue); Table errorTable = batchRuntimeContext.getDataset(excelInputreaderConfig.errorDatasetName); errorTable.write(errorRecordBuilder.build()); break;
@Override public void initialize(BatchRuntimeContext context) { outputSchema = context.getOutputSchema(); fields = conf.getFields(); }
@Override public void initialize(BatchRuntimeContext context) throws Exception { super.initialize(context); if (config.schema != null) { // should never happen, just done to test App correctness in unit tests Schema outputSchema = Schema.parseJson(config.schema); if (!outputSchema.equals(context.getOutputSchema())) { throw new IllegalStateException("Output schema does not match what was set at configure time."); } } }