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 06:49:20 UTC

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

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

 ##########
 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:
   this is actually checking when the schema is updated. So im checking for columns and then removing the datamap, and creates new datamap for the latest schema

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