Github user xuchuanyin commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2211#discussion_r183378864
--- 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 --
Having a statement to do this means that we need to store the related
information.
I also have considered to store the visible/invisible information in
DataMapSchema/DataMapStatus related, but found that currently there is no place
other than file to store them.
Besides, this feature is introduced for tuning, which means the status may
change frequently. Having a file stored information may need frequently refresh
& read the DataMapSchemaFile.
By using a set command here, we don't have to make the information durable.
It meets our needs and can be implemented easily.
@jackylk How do you think about it?
---