hust-hhb opened a new pull request, #18161:
URL: https://github.com/apache/doris/pull/18161

   when loading big file with multi bytes  line delimiter, some line record 
maybe incomplete because of `_output_buf_limit`, so this incomplete data will 
move to the beginning of the output buf and read more data into output buf. In 
this case, find line delimiter should start with no offset to avoid a bug that 
spilt two lines as one line.
   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   Here is an example, the line delimiter is `^C^C^A`, and output buf remaining 
data is
   `YkRikHOZcAbf8bQS2PhHv3uk|ryowwwiVoFPL|-996021625^C`
   the remaining data is incomplete line so move this data to the beginning of 
the current output buf and read more data into output buf. So the output buf 
may like this
   ```
   YkRikHOZcAbf8bQS2PhHv3uk|ryowwwiVoFP|-996021625^C^C^A
   P9wnGJ5BkPP4Zwo11RdmsWDN|8rKArr2FDVbu|-827465582^C^C^A
   cist1Q6OAn7NQyAfBQ8rOciP|sFSiVvJcT05M
   ```
   After last read buf, the offset will be at this point
   ```
                                                 offset
                                                   |
                                                   |
   YkRikHOZcAbf8bQS2PhHv3uk|ryowwwiVoFP|-996021625^C^C^A
   P9wnGJ5BkPP4Zwo11RdmsWDN|8rKArr2FDVbu|-827465582^C^C^A
   cist1Q6OAn7NQyAfBQ8rOciP|sFSiVvJcT05M
   ```
   If we find line delimiter start with offset, the next line delimiter will be 
at this
   ```
   YkRikHOZcAbf8bQS2PhHv3uk|ryowwwiVoFP|-996021625^C^C^A
   P9wnGJ5BkPP4Zwo11RdmsWDN|8rKArr2FDVbu|-827465582^C^C^A
   cist1Q6OAn7NQyAfBQ8rOciP|sFSiVvJcT05M                |
                                                        |
                                                  line delimiter
   ```
   and this will split tow line as one line, so find line  delimiter should 
start with no offset.
   Describe your changes.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


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