InvisibleProgrammer commented on code in PR #5265:
URL: https://github.com/apache/hive/pull/5265#discussion_r1618715447
##########
ql/src/java/org/apache/hadoop/hive/ql/io/SkippingTextInputFormat.java:
##########
@@ -110,17 +110,32 @@ private long getCachedStartIndex(Path path) throws
IOException {
fileSystem = path.getFileSystem(conf);
try {
fis = fileSystem.open(path);
+ long currPos = fis.getPos();
+ int delimiterIdx = -1;
for (int j = 0; j < headerCount; j++) {
- if (fis.readLine() == null) {
+ String headerLine = fis.readLine();
+ if (headerLine == null) {
startIndexMap.put(path, Long.MAX_VALUE);
return Long.MAX_VALUE;
}
+ if (j == headerCount-1) {
+ String delimiter = conf.get("textinputformat.record.delimiter");
Review Comment:
I would read the delimiter only once, outside of the for loop.
--
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]