[ 
https://issues.apache.org/jira/browse/BEAM-2790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16165999#comment-16165999
 ] 

ASF GitHub Bot commented on BEAM-2790:
--------------------------------------

GitHub user echauchot opened a pull request:

    https://github.com/apache/beam/pull/3850

    [BEAM-2790] Use byte[] instead of ByteBuffer to read from HadoopFilesystem

    Follow this checklist to help us incorporate your contribution quickly and 
easily:
    
     - [X] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/projects/BEAM/issues/) filed for the 
change (usually before you start working on it).  Trivial changes like typos do 
not require a JIRA issue.  Your pull request should address just this issue, 
without pulling in other changes.
     - [X] Each commit in the pull request should have a meaningful subject 
line and body.
     - [X] Format the pull request title like `[BEAM-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA 
issue.
     - [X] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
     - [X] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
     - [X] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
    
    ---
    This is the continuation of PR https://github.com/apache/beam/pull/3744. It 
fixes the code to deal with the offsets/limits to have the same behavior than 
read(ByteBuffer) and it adds corner cases tests.
    R: @lukecwik @steveloughran
    CC: @iemejia 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/echauchot/beam 
byte_array_instead_of_ByBuffer_HadoopFS2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/beam/pull/3850.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3850
    
----
commit ed5ba0c2ecc6e3a0b305cb9928d610f8ab58acbe
Author: Etienne Chauchot <[email protected]>
Date:   2017-09-14T08:28:12Z

    [BEAM-2790] Use byte[] instead of ByteBuffer to read from HadoopFilesystem

----


> Error while reading from Amazon S3 via Hadoop File System
> ---------------------------------------------------------
>
>                 Key: BEAM-2790
>                 URL: https://issues.apache.org/jira/browse/BEAM-2790
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-extensions
>    Affects Versions: 2.0.0, 2.1.0
>            Reporter: Ismaël Mejía
>            Assignee: Etienne Chauchot
>             Fix For: 2.2.0
>
>
> If you try to use hadoop-aws with Beam to read from AWS S3 it breaks because 
> S3AInputStream (the implementation of Hadoop's FSDataInputStream) is not 
> ByteBufferReadable. 
> {code}
> Exception in thread "main" java.lang.UnsupportedOperationException: 
> Byte-buffer read unsupported by input stream
>       at 
> org.apache.hadoop.fs.FSDataInputStream.read(FSDataInputStream.java:146)
>       at 
> org.apache.beam.sdk.io.hdfs.HadoopFileSystem$HadoopSeekableByteChannel.read(HadoopFileSystem.java:192)
>       at 
> org.apache.beam.sdk.io.TextSource$TextBasedReader.tryToEnsureNumberOfBytesInBuffer(TextSource.java:232)
>       at 
> org.apache.beam.sdk.io.TextSource$TextBasedReader.findSeparatorBounds(TextSource.java:166)
>       at 
> org.apache.beam.sdk.io.TextSource$TextBasedReader.readNextRecord(TextSource.java:198)
>       at 
> org.apache.beam.sdk.io.FileBasedSource$FileBasedReader.advanceImpl(FileBasedSource.java:481)
>       at 
> org.apache.beam.sdk.io.FileBasedSource$FileBasedReader.startImpl(FileBasedSource.java:476)
>       at 
> org.apache.beam.sdk.io.OffsetBasedSource$OffsetBasedReader.start(OffsetBasedSource.java:261)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to