public void materializeIndex(String storageName, DrillIndexDescriptor index) { index.setStorageName(storageName); index.setDrillTable(buildDrillTable(index)); }
@Override public IndexGroupScan getIndexGroupScan() { try { final DrillTable idxTable = getDrillTable(); GroupScan scan = idxTable.getGroupScan(); if (!(scan instanceof IndexGroupScan)){ logger.error("The Groupscan from table {} is not an IndexGroupScan", idxTable.toString()); return null; } return (IndexGroupScan)scan; } catch(IOException e) { logger.error("Error in getIndexGroupScan ", e); } return null; }
public IndexCollection getTableIndex(String tableName, String storageName, Collection<DrillIndexDefinition> indexDefs ) { Set<DrillIndexDescriptor> idxSet = new HashSet<>(); for (DrillIndexDefinition def : indexDefs) { DrillIndexDescriptor indexDescriptor = new DrillIndexDescriptor(def); materializeIndex(storageName, indexDescriptor); } return new DrillIndexCollection(getOriginalScanRel(), idxSet); }