akashrn5 commented on a change in pull request #3191: [CARBONDATA-3360]fix
NullPointerException in delete and clean files operation
URL: https://github.com/apache/carbondata/pull/3191#discussion_r279192139
##########
File path:
core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java
##########
@@ -683,6 +683,31 @@ private static boolean compareTimestampsAndDelete(
CarbonTablePath.DataFileUtil.getTimeStampFromFileName(invalidFile.getName()));
}
+ // This check is because, when there are some invalid files like
tableStatusUpdate.write files
+ // present in store [[which can happen during delete or update if the disk
is full or hdfs quota
+ // is finished]] then fileTimestamp will be null, in that case check for
max query out and
+ // delete the .write file after timeout
+ if (fileTimestamp == null) {
+ String tableUpdateStatusFilename = invalidFile.getName();
+ if (tableUpdateStatusFilename.endsWith(".write")) {
+ long tableUpdateStatusFileTimeStamp =
Long.parseLong(tableUpdateStatusFilename
+
.substring(tableUpdateStatusFilename.lastIndexOf(CarbonCommonConstants.HYPHEN)
+ 1,
+ invalidFile.getName().indexOf(".")));
+ if (isMaxQueryTimeoutExceeded(tableUpdateStatusFileTimeStamp)) {
+ try {
+ LOGGER.info("deleting the invalid .write file : " +
invalidFile.getName());
Review comment:
done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services