@Test public void testAvroWithUpsert() throws IOException, SQLException { String[] argv = { "--update-key", "ID", "--update-mode", "allowinsert" }; final int TOTAL_RECORDS = 2; // ColumnGenerator gen = colGenerator("100", // Schema.create(Schema.Type.STRING), null, "VARCHAR(64)"); createAvroFile(0, TOTAL_RECORDS); createTableWithInsert(); thrown.expect(Exception.class); thrown.reportMissingExceptionWithMessage("Expected Exception during Avro export with --update-mode"); runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1))); }
@Test public void testAvroWithUpdateKey() throws IOException, SQLException { String[] argv = { "--update-key", "ID" }; final int TOTAL_RECORDS = 1; // ColumnGenerator gen = colGenerator("100", // Schema.create(Schema.Type.STRING), null, "VARCHAR(64)"); createAvroFile(0, TOTAL_RECORDS); createTableWithInsert(); runExport(getArgv(true, 10, 10, newStrArray(argv, "-m", "" + 1))); verifyExport(getMsgPrefix() + "0"); }