okumin commented on code in PR #4500:
URL: https://github.com/apache/hive/pull/4500#discussion_r1269548650


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java:
##########
@@ -111,7 +135,7 @@ private void processKeyValuePairs(Object key, Object value)
         prevPath = k.getInputPath();
       }
       if (reader == null) {
-        reader = OrcFile.createReader(fs, k.getInputPath());
+        reader = OrcFile.createReader(getInputFileSystem(), k.getInputPath());

Review Comment:
   Is it straightforward to generate a filesystem or scheme from 
`k.getInputPath` rather than accessing 
`mapreduce.input.fileinputformat.inputdir`? I expect the schema or path prefix 
of both are identical. 
   We also don't need to parse URI in this class(e.g. I think 
`{schema}/path/to/...` is valid as a URI).
   I assume it doesn't happen that we merge files on multiple file systems.



##########
ql/src/java/org/apache/hadoop/hive/ql/exec/OrcFileMergeOperator.java:
##########
@@ -78,6 +82,26 @@ public void process(Object row, int tag) throws 
HiveException {
     processKeyValuePairs(keyValue[0], keyValue[1]);
   }
 
+  public FileSystem getInputFileSystem() throws IOException {
+    synchronized (this) {

Review Comment:
   I guess this is invoked on a single thread.



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

Reply via email to