abstractdog commented on code in PR #3836:
URL: https://github.com/apache/hive/pull/3836#discussion_r1083273355
##########
ql/src/test/org/apache/hadoop/hive/ql/exec/TestFileSinkOperator.java:
##########
@@ -183,37 +183,42 @@ public void testNonAcidRemoveDuplicate() throws Exception
{
JobConf jobConf2 = new JobConf(jobConf);
jobConf2.set("mapred.task.id", "000000_1");
- FileSinkOperator speculative = (FileSinkOperator)OperatorFactory.get(
+ FileSinkOperator op2 = (FileSinkOperator)OperatorFactory.get(
new CompilationOpContext(), FileSinkDesc.class);
- speculative.setConf(desc);
- speculative.initialize(jobConf2, new ObjectInspector[]{inspector});
+ op2.setConf(desc);
+ op2.initialize(jobConf2, new ObjectInspector[]{inspector});
for (Object r : rows) {
op1.process(r, 0);
- speculative.process(r, 0);
+ op2.process(r, 0);
}
op1.close(false);
- // speculative task also ends successfully
- speculative.close(false);
+ // Assume op2 also ends successfully, this happens in different containers
+ op2.close(false);
Path[] paths = findFilesInBasePath();
List<Path> mondays = Arrays.stream(paths)
.filter(path ->
path.getParent().toString().endsWith("partval=Monday/HIVE_UNION_SUBDIR_0"))
.collect(Collectors.toList());
- Assert.assertTrue(mondays.size() == 2);
+ Assert.assertEquals("Two result files were created", 2, mondays.size());
Set<String> fileNames = new HashSet<>();
fileNames.add(mondays.get(0).getName());
fileNames.add(mondays.get(1).getName());
- Assert.assertTrue(fileNames.contains("000000_1") &&
fileNames.contains("000000_0"));
+ Assert.assertTrue("000000_1 file is expected",
fileNames.contains("000000_1"));
+ Assert.assertTrue("000000_0 file is expected",
fileNames.contains("000000_0"));
+
+ // This happens in HiveServer2 when the job is finished, the job will call
Review Comment:
are you sure it's HiveServer2? as jobCloseOp is part of the operator
pipeline, they run as part of the execution in the tasks, am I missing
something?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]