[GitHub] [carbondata] zzcclp commented on a change in pull request #3449: [CARBONDATA-3578] Make table status file smaller

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] zzcclp commented on a change in pull request #3449: [CARBONDATA-3578] Make table status file smaller

GitBox
zzcclp commented on a change in pull request #3449: [CARBONDATA-3578] Make table status file smaller
URL: https://github.com/apache/carbondata/pull/3449#discussion_r346105074
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/statusmanager/LoadMetadataDetails.java
 ##########
 @@ -468,4 +482,26 @@ public boolean isCarbonFormat() {
     return getFileFormat().equals(FileFormat.COLUMNAR_V3)
         || getFileFormat().equals(FileFormat.ROW_V1);
   }
+
+  /**
+   * Before writing table status file, call this to make the metadata smaller.
+   * It checks if fields are default value, then make it null so GSON does not write it
+   */
+  void removeUnnecessaryField() {
+    if (updateDeltaEndTimestamp == null || updateDeltaStartTimestamp.isEmpty()) {
+      updateDeltaEndTimestamp = null;
+    }
+    if (updateDeltaStartTimestamp == null || updateDeltaStartTimestamp.isEmpty()) {
+      updateDeltaStartTimestamp = null;
+    }
+    if (updateStatusFileName == null || updateStatusFileName.isEmpty()) {
 
 Review comment:
   It's better use StringUtils.isEmpty()

----------------------------------------------------------------
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]


With regards,
Apache Git Services