nsivabalan commented on pull request #2500:
URL: https://github.com/apache/hudi/pull/2500#issuecomment-791962579


   Finally able to get hold of it. I set up a cluster w/ gcloud dataproc and 
tested it out. Even existing PR didn't work(before my latest commit). 
   
   fsDataInputStream.getWrappedStream() refers to 
com.google.cloud.hadoop.fs.gcs.GoogleHadoopFSInputStream. This is an instance 
of FSInputStream. And so, we may not get into the 2nd else if block at all(if 
first if condition is wrapped stream instance of FSInputStream).
   
   So, the actual fix is something like this.
   ```
   FSDataInputStream inputStreamLocal;
   if(wrapped stream instance of FSInputStream) {
        inputStreamLocal = new Timed...(new Buffered ... ((FSInputStream) 
fsDataInputStream.getWrappedStream())....);
       if( GCS ) { // wrap with SchemeAwareFSDataInputStream to intercept seek 
calls. 
            inputStreamLocal = new 
SchemeAwareFSDataInputStream(inputStreamLocal);
       }
   } else {
      inputStreamLocal = fsDataInputStream;
   }
   ```
   Have updated the PR with the fix. I also tested with GCS FS and it works. 
   
   
     
   
    


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to