Github user hyunsik commented on a diff in the pull request:

    https://github.com/apache/tajo/pull/289#discussion_r21501517
  
    --- Diff: 
tajo-storage/src/main/java/org/apache/tajo/storage/text/ByteBufLineReader.java 
---
    @@ -120,24 +118,34 @@ private void fillBuffer() throws IOException {
        * Read a line terminated by one of CR, LF, or CRLF.
        */
       public ByteBuf readLineBuf(AtomicInteger reads) throws IOException {
    -    if(eof) return null;
    -
    -    int startIndex = buffer.readerIndex();
    -    int readBytes;
    +    int readBytes = 0;
    +    int newlineLength = 0; //length of terminating newline
         int readable;
    -    int newlineLength; //length of terminating newline
    +
    +    this.startIndex = buffer.readerIndex();
     
         loop:
         while (true) {
           readable = buffer.readableBytes();
           if (readable <= 0) {
    -        buffer.readerIndex(startIndex);
    +        buffer.readerIndex(this.startIndex);
             fillBuffer(); //compact and fill buffer
    -        if (!buffer.isReadable()) {
    +        if (!buffer.isReadable() && buffer.writerIndex() == 0) {
    --- End diff --
    
    Could you add comments about this case?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to