[GitHub] ravipesala commented on a change in pull request #3121: [CARBONDATA-3287]Remove the validation for same schema in a location and fix drop datamap issue

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

[GitHub] ravipesala commented on a change in pull request #3121: [CARBONDATA-3287]Remove the validation for same schema in a location and fix drop datamap issue

GitBox
ravipesala commented on a change in pull request #3121: [CARBONDATA-3287]Remove the validation for same schema in a location and fix drop datamap issue
URL: https://github.com/apache/carbondata/pull/3121#discussion_r254145827
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
 ##########
 @@ -322,6 +322,18 @@ public TableDataMap getDataMap(CarbonTable table, DataMapSchema dataMapSchema) {
         tableIndices = allDataMaps.get(tableUniqueName);
       }
     }
+    // in case of fileformat, when table is dropped the datamaps are not cleared, they need to be
+    // cleared by using API, so in the same session, if the table is created again with same name
+    // and columns(may be with different name or datatype), the datamap will be returned for old
+    // table only as the table unique name is same, so compare the columns, if not same, clear the
+    // datamaps on that table
+    if (allDataMaps.size() > 0 && null != allDataMaps.get(tableUniqueName)
+        && allDataMaps.get(tableUniqueName).size() > 0 && !allDataMaps.get(tableUniqueName).get(0)
+        .getTable().getTableInfo().getFactTable().getListOfColumns()
+        .equals(table.getTableInfo().getFactTable().getListOfColumns())) {
 
 Review comment:
   No need to check this list of columns equals check. Just check for tableid would be enough

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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