/** independent to target-dir. */ @Test public void testAppend() throws IOException { ArrayList args = getOutputlessArgv(false, false, HsqldbTestServer.getFieldNames(), getConf()); args.add("--warehouse-dir"); args.add(getWarehouseDir()); Path output = new Path(getWarehouseDir(), HsqldbTestServer.getTableName()); runAppendTest(args, output); }
/** * Test that when we pass in -Dmapreduce.output.basename=prefix, file should also got appended * * @throws IOException */ @Test public void testAppendWithMapreduceOutputBasename() throws IOException { String prefix = "prefix-test"; ArrayList<String> args = new ArrayList<>(); args.add("-D"); args.add(MAPREDUCE_OUTPUT_BASENAME_PROPERTY + "=" + prefix); args.addAll(getOutputlessArgv(false, true, HsqldbTestServer.getFieldNames(), getConf())); String targetDir = getWarehouseDir() + "/tempTargetDirOutputBaseNameTest"; args.add("--target-dir"); args.add(targetDir); Path output = new Path(targetDir); runAppendTest(args, output, prefix); } }
/** working with target-dir. */ @Test public void testAppendToTargetDir() throws IOException { ArrayList args = getOutputlessArgv(false, false, HsqldbTestServer.getFieldNames(), getConf()); String targetDir = getWarehouseDir() + "/tempTargetDir"; args.add("--target-dir"); args.add(targetDir); // there's no need for a new param // in diff. w/--warehouse-dir there will no be $tablename dir Path output = new Path(targetDir); runAppendTest(args, output); }
/** * Query based import should also work in append mode. * * @throws IOException */ @Test public void testAppendWithQuery() throws IOException { ArrayList args = getOutputlessArgv(false, true, HsqldbTestServer.getFieldNames(), getConf()); String targetDir = getWarehouseDir() + "/tempTargetDir"; args.add("--target-dir"); args.add(targetDir); Path output = new Path(targetDir); runAppendTest(args, output); }