public void alterCubeDimensionTable(XDimensionTable dimensionTable) throws LensException, HiveException { alterCubeDimensionTable(dimensionTable.getTableName(), JAXBUtils.cubeDimTableFromDimTable(dimensionTable), JAXBUtils.tableDescPrefixMapFromXStorageTables(dimensionTable.getStorageTables())); } /**
public void alterCubeDimensionTable(XDimensionTable dimensionTable) throws LensException, HiveException { alterCubeDimensionTable(dimensionTable.getTableName(), JAXBUtils.cubeDimTableFromDimTable(dimensionTable), JAXBUtils.tableDescPrefixMapFromXStorageTables(dimensionTable.getStorageTables())); }
@Override public void addStorageToFact(LensSessionHandle sessionid, String fact, XStorageTableElement storageTable) throws LensException { Set<UpdatePeriod> updatePeriods = new TreeSet<>(); for (XUpdatePeriod sup : storageTable.getUpdatePeriods().getUpdatePeriod()) { updatePeriods.add(UpdatePeriod.valueOf(sup.name())); } try (SessionContext ignored = new SessionContext(sessionid)) { CubeMetastoreClient msClient = getClient(sessionid); XStorageTables tables = new XStorageTables(); tables.getStorageTable().add(storageTable); msClient.addStorage(msClient.getCubeFactTable(fact), storageTable.getStorageName(), updatePeriods, JAXBUtils.tableDescPrefixMapFromXStorageTables(tables), JAXBUtils.storageTablePrefixMapOfStorage(tables).get(storageTable.getStorageName())); log.info("Added storage " + storageTable.getStorageName() + ":" + updatePeriods + " for fact " + fact); } }
public void createCubeDimensionTable(XDimensionTable xDimTable) throws LensException { List<FieldSchema> columns = JAXBUtils.fieldSchemaListFromColumns(xDimTable.getColumns()); Map<String, UpdatePeriod> updatePeriodMap = JAXBUtils.dumpPeriodsFromStorageTables(xDimTable.getStorageTables()); Map<String, String> properties = JAXBUtils.mapFromXProperties(xDimTable.getProperties()); Map<String, StorageTableDesc> storageDesc = JAXBUtils.tableDescPrefixMapFromXStorageTables( xDimTable.getStorageTables()); log.info("# Columns: " + columns); createCubeDimensionTable(xDimTable.getDimensionName(), xDimTable.getTableName(), columns, xDimTable.getWeight(), updatePeriodMap, properties, storageDesc); } /**
public void alterCubeFactTable(XFact fact) throws LensException, HiveException { if (fact instanceof XVirtualFactTable) { XVirtualFactTable xvf = (XVirtualFactTable) fact; alterCubeFactTable(xvf.getName(), JAXBUtils.cubeVirtualFactFromFactTable(xvf, getFactTable(xvf.getSourceFactName())), null, new HashMap<>()); } else { XFactTable xf = (XFactTable) fact; alterCubeFactTable(fact.getName(), JAXBUtils.cubeFactFromFactTable(xf), JAXBUtils.tableDescPrefixMapFromXStorageTables(xf.getStorageTables()), JAXBUtils.columnStartAndEndTimeFromXColumns(xf.getColumns())); } }
public void createCubeDimensionTable(XDimensionTable xDimTable) throws LensException { List<FieldSchema> columns = JAXBUtils.fieldSchemaListFromColumns(xDimTable.getColumns()); Map<String, UpdatePeriod> updatePeriodMap = JAXBUtils.dumpPeriodsFromStorageTables(xDimTable.getStorageTables()); Map<String, String> properties = JAXBUtils.mapFromXProperties(xDimTable.getProperties()); Map<String, StorageTableDesc> storageDesc = JAXBUtils.tableDescPrefixMapFromXStorageTables( xDimTable.getStorageTables()); log.info("# Columns: " + columns); createCubeDimensionTable(xDimTable.getDimensionName(), xDimTable.getTableName(), columns, xDimTable.getWeight(), updatePeriodMap, properties, storageDesc); }
public void alterCubeFactTable(XFact fact) throws LensException, HiveException { if (fact instanceof XVirtualFactTable) { XVirtualFactTable xvf = (XVirtualFactTable) fact; alterCubeFactTable(xvf.getName(), JAXBUtils.cubeVirtualFactFromFactTable(xvf, getFactTable(xvf.getSourceFactName())), null, new HashMap<>()); } else { XFactTable xf = (XFactTable) fact; alterCubeFactTable(fact.getName(), JAXBUtils.cubeFactFromFactTable(xf), JAXBUtils.tableDescPrefixMapFromXStorageTables(xf.getStorageTables()), JAXBUtils.columnStartAndEndTimeFromXColumns(xf.getColumns())); } }
public void createFactTable(XFact fact) throws LensException { if (fact instanceof XVirtualFactTable) { XVirtualFactTable xvf = (XVirtualFactTable) fact; createVirtualFactTable(xvf.getCubeName(), xvf.getName(), xvf.getSourceFactName(), xvf.getWeight(), JAXBUtils.mapFromXProperties(xvf.getProperties())); } else { XFactTable xf = (XFactTable) fact; createCubeFactTable(fact.getCubeName(), fact.getName(), JAXBUtils.fieldSchemaListFromColumns(xf.getColumns()), JAXBUtils.getFactUpdatePeriodsFromStorageTables(xf.getStorageTables()), xf.getWeight(), addFactColStartTimePropertyToFactProperties(xf), JAXBUtils.tableDescPrefixMapFromXStorageTables(xf.getStorageTables()), JAXBUtils.storageTablePrefixMapOfStorage(xf.getStorageTables())); } }
public void createFactTable(XFact fact) throws LensException { if (fact instanceof XVirtualFactTable) { XVirtualFactTable xvf = (XVirtualFactTable) fact; createVirtualFactTable(xvf.getCubeName(), xvf.getName(), xvf.getSourceFactName(), xvf.getWeight(), JAXBUtils.mapFromXProperties(xvf.getProperties())); } else { XFactTable xf = (XFactTable) fact; createCubeFactTable(fact.getCubeName(), fact.getName(), JAXBUtils.fieldSchemaListFromColumns(xf.getColumns()), JAXBUtils.getFactUpdatePeriodsFromStorageTables(xf.getStorageTables()), xf.getWeight(), addFactColStartTimePropertyToFactProperties(xf), JAXBUtils.tableDescPrefixMapFromXStorageTables(xf.getStorageTables()), JAXBUtils.storageTablePrefixMapOfStorage(xf.getStorageTables()), JAXBUtils.getStorageTablePartitionColumnsFromTableDescs(xf.getStorageTables())); } }