Indhumathi27 commented on a change in pull request #3688: [CARBONDATA-3765]
Refactor Index Metadata for CG and FG Indexes
URL: https://github.com/apache/carbondata/pull/3688#discussion_r405973637
##########
File path:
core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
##########
@@ -101,49 +100,29 @@ private DataMapStoreManager() {
}
/**
- * It only gives the visible datamaps
- */
- List<TableIndex> getAllVisibleIndexes(CarbonTable carbonTable) throws
IOException {
- CarbonSessionInfo sessionInfo =
ThreadLocalSessionInfo.getCarbonSessionInfo();
- List<TableIndex> allDataMaps = getAllIndexes(carbonTable);
- Iterator<TableIndex> dataMapIterator = allDataMaps.iterator();
- while (dataMapIterator.hasNext()) {
- TableIndex dataMap = dataMapIterator.next();
- String dbName = carbonTable.getDatabaseName();
- String tableName = carbonTable.getTableName();
- String dmName = dataMap.getDataMapSchema().getDataMapName();
- // TODO: need support get the visible status of datamap without
sessionInfo in the future
- if (sessionInfo != null) {
- boolean isDmVisible = sessionInfo.getSessionParams().getProperty(
- String.format("%s%s.%s.%s",
CarbonCommonConstants.CARBON_DATAMAP_VISIBLE,
- dbName, tableName, dmName),
"true").trim().equalsIgnoreCase("true");
- if (!isDmVisible) {
- LOGGER.warn(String.format("Ignore invisible datamap %s on table
%s.%s",
- dmName, dbName, tableName));
- dataMapIterator.remove();
- }
- } else {
- String message = "Carbon session info is null";
- LOGGER.info(message);
- }
- }
- return allDataMaps;
- }
-
- /**
- * It gives all indexes except the default index.
+ * It gives all indexes except the default index and secondary index.
+ * Collect's Coarse grain and Fine grain indexes on a table
*
* @return
*/
public List<TableIndex> getAllIndexes(CarbonTable carbonTable) throws
IOException {
- List<DataMapSchema> dataMapSchemas = getDataMapSchemasOfTable(carbonTable);
+ String indexMeta =
carbonTable.getTableInfo().getFactTable().getTableProperties()
+ .get(carbonTable.getCarbonTableIdentifier().getTableId());
Review comment:
Secondary index info is already stored in table with key as table-id. Used
the same
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services