Copilot commented on code in PR #2660:
URL: https://github.com/apache/phoenix/pull/2660#discussion_r4485005580


##########
phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/index/IndexTool.java:
##########
@@ -806,6 +806,12 @@ private Job configureSubmittableJobUsingDirectApi(Job job) 
throws Exception {
       job.setMapOutputValueClass(IntWritable.class);
       job.setOutputKeyClass(NullWritable.class);
       job.setOutputValueClass(NullWritable.class);
+      // The mappers write the index rows directly. The reducer only updates 
the index state and
+      // emits no records. The output path is optional, and a file output 
format without a path
+      // fails the job submission.
+      if (FileOutputFormat.getOutputPath(job) == null) {
+        job.setOutputFormatClass(NullOutputFormat.class);
+      }

Review Comment:
   `NullOutputFormat` is only set conditionally when no output path is present. 
If an output path is provided (even though reducers emit no records), the job 
will still use the default `FileOutputFormat` and may create empty `_SUCCESS` / 
output directories unnecessarily. If the intended behavior is “no file output 
for this tool” regardless of output path, consider always setting 
`NullOutputFormat` and ignoring any provided output path (or explicitly 
documenting that providing an output path changes job output semantics).



-- 
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]

Reply via email to