/** * 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 createDimension(LensSessionHandle sessionid, XDimension dimension) throws LensException { try (SessionContext ignored = new SessionContext(sessionid)){ getClient(sessionid).createDimension(dimension); log.info("Created dimension " + dimension.getName()); } }
public static Dimension dimensionFromXDimension(XDimension dimension) throws LensException { Set<CubeDimAttribute> dims = new LinkedHashSet<CubeDimAttribute>(); for (XDimAttribute xd : dimension.getAttributes().getDimAttribute()) { dims.add(hiveDimAttrFromXDimAttr(xd)); } Set<ExprColumn> expressions = new LinkedHashSet<ExprColumn>(); if (dimension.getExpressions() != null && !dimension.getExpressions().getExpression().isEmpty()) { for (XExprColumn xe : dimension.getExpressions().getExpression()) { expressions.add(hiveExprColumnFromXExprColumn(xe)); } } Set<JoinChain> joinchains = new LinkedHashSet<JoinChain>(); if (dimension.getJoinChains() != null && !dimension.getJoinChains().getJoinChain().isEmpty()) { for (XJoinChain xj : dimension.getJoinChains().getJoinChain()) { joinchains.add(joinChainFromXJoinChain(xj)); } } Map<String, String> properties = mapFromXProperties(dimension.getProperties()); return new Dimension(dimension.getName(), dims, expressions, joinchains, properties, 0L); }
public static Dimension dimensionFromXDimension(XDimension dimension) throws LensException { Set<CubeDimAttribute> dims = new LinkedHashSet<CubeDimAttribute>(); for (XDimAttribute xd : dimension.getAttributes().getDimAttribute()) { dims.add(hiveDimAttrFromXDimAttr(xd)); } Set<ExprColumn> expressions = new LinkedHashSet<ExprColumn>(); if (dimension.getExpressions() != null && !dimension.getExpressions().getExpression().isEmpty()) { for (XExprColumn xe : dimension.getExpressions().getExpression()) { expressions.add(hiveExprColumnFromXExprColumn(xe)); } } Set<JoinChain> joinchains = new LinkedHashSet<JoinChain>(); if (dimension.getJoinChains() != null && !dimension.getJoinChains().getJoinChain().isEmpty()) { for (XJoinChain xj : dimension.getJoinChains().getJoinChain()) { joinchains.add(joinChainFromXJoinChain(xj)); } } Map<String, String> properties = mapFromXProperties(dimension.getProperties()); return new Dimension(dimension.getName(), dims, expressions, joinchains, properties, 0L); }
assertEquals(testDim.getName(), "testdim"); assertTrue(testDim.getProperties().getProperty().size() >= 1); assertTrue(JAXBUtils.mapFromXProperties(testDim.getProperties()).containsKey("dimension.foo")); assertEquals(altered.getName(), "testdim"); assertTrue(altered.getProperties().getProperty().size() >= 2); assertTrue(JAXBUtils.mapFromXProperties(altered.getProperties()).containsKey("dim.prop2.name")); target.path("testdim").queryParam("sessionid", lensSessionId).request( mediaType).get(new GenericType<JAXBElement<XDimension>>() {}); fail("Should have thrown 404, but got" + got.getValue().getName()); } catch (NotFoundException ex) { log.error("Resource not found.", ex);
theName = this.getName(); strategy.appendField(locator, this, "name", buffer, theName);
theName = this.getName(); strategy.appendField(locator, this, "name", buffer, theName);
theName = this.getName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName);
theName = this.getName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName);