mayankkunwar commented on code in PR #5265:
URL: https://github.com/apache/hive/pull/5265#discussion_r1618763252
##########
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:
Since the scope of delimiter is only inside the loop, just for last
iteration, that's why I have defined it here.
If it was used outside the loop as well, I would have moved it outside "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]