Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2272#discussion_r186692770
--- Diff:
datamap/bloom/src/main/java/org/apache/carbondata/datamap/bloom/BloomCoarseGrainDataMapFactory.java
---
@@ -154,12 +158,68 @@ public DataMapRefresher createRefresher(Segment
segment, String shardName) throw
@Override
public List<CoarseGrainDataMap> getDataMaps(DataMapDistributable
distributable)
throws IOException {
- return null;
+ List<CoarseGrainDataMap> coarseGrainDataMaps = new ArrayList<>();
+ BloomCoarseGrainDataMap bloomCoarseGrainDataMap = new
BloomCoarseGrainDataMap();
+ String indexPath = ((BloomDataMapDistributable)
distributable).getIndexPath();
+ try {
+ bloomCoarseGrainDataMap.init(new DataMapModel(indexPath));
+ } catch (IOException e) {
+ LOGGER.error(e, "Failed to get bloom datamap");
+ return coarseGrainDataMaps;
+ }
+ coarseGrainDataMaps.add(bloomCoarseGrainDataMap);
+ return coarseGrainDataMaps;
+ }
+
+ /**
+ * returns all the directories of lucene index files for query
+ * Note: copied from luceneDataMapFactory, will extract to a common
interface
+ */
+ private CarbonFile[] getAllIndexDirs(String tablePath, String segmentId)
{
+ List<CarbonFile> indexDirs = new ArrayList<>();
+ List<TableDataMap> dataMaps = new ArrayList<>();
+ try {
+ // there can be multiple bloom datamaps present on a table, so get
all datamaps and form
+ // the path till the index file directories in all datamaps folders
present in each segment
+ dataMaps =
DataMapStoreManager.getInstance().getAllDataMap(getCarbonTable());
+ } catch (IOException ex) {
+ LOGGER.error("failed to get datamaps");
--- End diff --
should throw ex
---