Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2211#discussion_r183375720
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java 
---
    @@ -92,6 +95,30 @@ private DataMapStoreManager() {
         return dataMaps;
       }
     
    +  /**
    +   * It only gives the visible datamaps
    +   */
    +  private List<TableDataMap> getAllVisibleDataMap(CarbonTable carbonTable) 
throws IOException {
    +    CarbonSessionInfo sessionInfo = 
ThreadLocalSessionInfo.getCarbonSessionInfo();
    +    List<TableDataMap> allDataMaps = getAllDataMap(carbonTable);
    +    Iterator<TableDataMap> dataMapIterator = allDataMaps.iterator();
    +    while (dataMapIterator.hasNext()) {
    +      TableDataMap dataMap = dataMapIterator.next();
    +      String dbName = carbonTable.getDatabaseName();
    +      String tableName = carbonTable.getTableName();
    +      String dmName = dataMap.getDataMapSchema().getDataMapName();
    +      boolean isDmVisible = sessionInfo.getSessionParams().getProperty(
    +          String.format("%s%s.%s.%s", 
CarbonCommonConstants.CARBON_DATAMAP_VISIBLE,
    --- End diff --
    
    It's not going to disable the datamap forever. It is only intend to see how 
this datamap will enhance performance during the query.
    As described in PR description, "Invisible datamap will only be ignored 
during query and user can still see this datmap and its data will be updated as 
normal."
    
    It is named after MySQL document, and have the similar function as it. 
Please refer "MySQL now supports invisible indexes" in this link: 
https://dev.mysql.com/doc/refman/8.0/en/mysql-nutshell.html


---

Reply via email to