[GitHub] [carbondata] jackylk 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] jackylk commented on a change in pull request #3449: [CARBONDATA-3578] Make table status file smaller

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

 ##########
 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()) {
+      updateStatusFileName = null;
+    }
+    if (visibility == null || visibility.equals("true")) {
+      visibility = null;
+    }
+    if (fileFormat == null || fileFormat.equals(FileFormat.COLUMNAR_V3.toString())) {
 
 Review comment:
   fixed

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