Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2211#discussion_r184031116
--- 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 --
@kumarvishal09 It
1. won't work on carbondata default datamap, such as
DefaultBlockletDataMap/PreAggregate/Timeseries,
2. and will work for extened datamaps, such as LuceneDataMap/BloomDataMap
The reason is that the visibility of datamap is done during blocklet
pruning, it seems PreAggregate/Timeseries won't arrive there and
DefaultBlockletDataMap will always come to effective.
---