[GitHub] [carbondata] Indhumathi27 commented on a change in pull request #3977: [CARBONDATA-4027] Fix the wrong modifiedtime of loading files in inse…

Posted by GitBox on
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-marchpure-opened-a-new-pull-request-3977-CARBONDATA-4027-Fix-the-wrong-modifiedtim-tp101637p101845.html


Indhumathi27 commented on a change in pull request #3977:
URL: https://github.com/apache/carbondata/pull/3977#discussion_r503982610



##########
File path: core/src/main/java/org/apache/carbondata/core/view/MVProvider.java
##########
@@ -545,14 +545,14 @@ private void touchMDTFile() throws IOException {
         FileFactory.createDirectoryAndSetPermission(this.systemDirectory,
             new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL));
       }
-      if (!FileFactory.isFileExist(this.schemaIndexFilePath)) {
-        FileFactory.createNewFile(
-            this.schemaIndexFilePath,
-            new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL));
+      if (FileFactory.isFileExist(this.schemaIndexFilePath)) {

Review comment:
       ```suggestion
         CarbonFile schemaIndexFile = FileFactory.getCarbonFile(this.schemaIndexFilePath);
         if (schemaIndexFile.exists()) {
           schemaIndexFile.delete();
         }
         schemaIndexFile.createNewFile(new FsPermission(FsAction.ALL, FsAction.ALL, FsAction.ALL));
         this.lastModifiedTime = schemaIndexFile.getLastModifiedTime();
   ```




----------------------------------------------------------------
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:
[hidden email]