You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/02/06 05:57:53 UTC

[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

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:
users@infra.apache.org


With regards,
Apache Git Services