/** * Drop a fact with cascade flag * * @param factName fact name * @param cascade If true, will drop all the storages of the fact * @throws LensException */ public void dropFact(String factName, boolean cascade) throws LensException { getTableWithTypeFailFast(factName, CubeTableType.FACT); FactTable fact = getFactTable(factName); if (cascade) { for (String storage : fact.getStorages()) { dropStorageFromFact(factName, storage, false); } } dropHiveTable(factName); allFactTables.remove(factName.trim().toLowerCase()); if (fact.isVirtualFact()) { String sourceFactTable = fact.getProperties().get(getSourceFactNameKey(fact.getName())); if (factToVirtualFactMapping.get(sourceFactTable) != null && factToVirtualFactMapping.get(sourceFactTable).contains(fact.getName())) { factToVirtualFactMapping.get(sourceFactTable).remove(fact.getName()); } } else { dropAllVirtualFactTables(factName); } }
/** * Drop a fact with cascade flag * * @param factName fact name * @param cascade If true, will drop all the storages of the fact * @throws LensException */ public void dropFact(String factName, boolean cascade) throws LensException { getTableWithTypeFailFast(factName, CubeTableType.FACT); FactTable fact = getFactTable(factName); checkIfAuthorized(); if (cascade) { for (String storage : fact.getStorages()) { dropStorageFromFact(factName, storage, false); } } dropHiveTable(factName); allFactTables.remove(factName.trim().toLowerCase()); if (fact.isVirtualFact()) { String sourceFactTable = fact.getProperties().get(getSourceFactNameKey(fact.getName())); if (factToVirtualFactMapping.get(sourceFactTable) != null && factToVirtualFactMapping.get(sourceFactTable).contains(fact.getName())) { factToVirtualFactMapping.get(sourceFactTable).remove(fact.getName()); } } else { dropAllVirtualFactTables(factName); } }
public XFact getXFactTable(FactTable ft) throws LensException { if (ft.isVirtualFact()) { CubeVirtualFactTable cvft = (CubeVirtualFactTable) ft; XVirtualFactTable factTable = JAXBUtils.virtualFactTableFromVirtualCubeFactTable(cvft);
public XFact getXFactTable(FactTable ft) throws LensException { if (ft.isVirtualFact()) { CubeVirtualFactTable cvft = (CubeVirtualFactTable) ft; XVirtualFactTable factTable = JAXBUtils.virtualFactTableFromVirtualCubeFactTable(cvft);