/** * Alter dimension specified by the dimension name to new definition * * @param newDim The new dimension definition * @throws HiveException */ public void alterDimension(XDimension newDim) throws HiveException, LensException { alterDimension(newDim.getName(), JAXBUtils.dimensionFromXDimension(newDim)); }
/** * Alter dimension specified by the dimension name to new definition * * @param newDim The new dimension definition * @throws HiveException */ public void alterDimension(XDimension newDim) throws HiveException, LensException { alterDimension(newDim.getName(), JAXBUtils.dimensionFromXDimension(newDim)); }
@Override public void updateDimension(LensSessionHandle sessionid, String dimName, XDimension dimension) throws LensException { try (SessionContext ignored = new SessionContext(sessionid)){ getClient(sessionid).alterDimension(dimension); log.info("Altered dimension " + dimName); } catch (HiveException e) { throw new LensException(e); } }
public <T extends Equals & HashCode & ToString> void updateEntity(String name, T entity) throws LensException, HiveException { if (entity instanceof XStorage) { alterStorage((XStorage) entity); } else if (entity instanceof XCube) { alterCube((XCube)entity); } else if (entity instanceof XDimension) { alterDimension((XDimension) entity); } else if (entity instanceof XFact) { alterCubeFactTable((XFact) entity); } else if (entity instanceof XDimensionTable) { alterCubeDimensionTable((XDimensionTable) entity); } else if (entity instanceof XSegmentation) { alterSegmentation((XSegmentation) entity); } else { throw new LensException("Unable to alter entity " + entity + " as it's unrecognizable: " + entity.getClass()); } }
public <T extends Equals & HashCode & ToString> void updateEntity(String name, T entity) throws LensException, HiveException { if (entity instanceof XStorage) { alterStorage((XStorage) entity); } else if (entity instanceof XCube) { alterCube((XCube)entity); } else if (entity instanceof XDimension) { alterDimension((XDimension) entity); } else if (entity instanceof XFact) { alterCubeFactTable((XFact) entity); } else if (entity instanceof XDimensionTable) { alterCubeDimensionTable((XDimensionTable) entity); } else if (entity instanceof XSegmentation) { alterSegmentation((XSegmentation) entity); } else { throw new LensException("Unable to alter entity " + entity + " as it's unrecognizable: " + entity.getClass()); } }
client.alterDimension(city.getName(), city); Dimension cityAltered = client.getDimension(city.getName()); assertEquals(1, cityAltered.getExpressionByName("stateAndCountry").getExpressions().size()); toAlter.alterJoinChain(zipState); client.alterDimension(zipDim.getName(), toAlter); Dimension altered = client.getDimension(zipDim.getName());