shunping-google commented on code in PR #29202:
URL: https://github.com/apache/beam/pull/29202#discussion_r1381831538
##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/TextSource.java:
##########
@@ -171,21 +194,42 @@ protected void startReading(ReadableByteChannel channel)
throws IOException {
} else {
startOfNextRecord = bufferPosn = (int) requiredPosition;
}
+ skipHeader(skipHeaderLines, true);
} else {
- ((SeekableByteChannel) channel).position(requiredPosition);
- startOfNextRecord = requiredPosition;
+ skipHeader(skipHeaderLines, false);
+ if (requiredPosition > startOfNextRecord) {
Review Comment:
I am wondering what will happen if multiple readers having requiredPosition
<= startOfNextRecord here.
In this case, more than readers are assigned to a start position that fall
in the header lines (assuming there are multiple long header lines). Not sure
if the current code is handling this.
--
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]