public XDimension withAttributes(XDimAttributes value) { setAttributes(value); return this; }
public XDimension withExpressions(XExpressions value) { setExpressions(value); return this; }
public XDimension withJoinChains(XJoinChains value) { setJoinChains(value); return this; }
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 XDimension xdimensionFromDimension(Dimension dimension) { XDimension xd = XCF.createXDimension(); xd.setName(dimension.getName()); xd.setAttributes(new XDimAttributes()); xd.setExpressions(new XExpressions()); xd.setJoinChains(new XJoinChains()); xd.setProperties(new XProperties()); xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties())); for (CubeDimAttribute cd : dimension.getAttributes()) { xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension)); } for (ExprColumn ec : dimension.getExpressions()) { xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec)); } for (JoinChain jc : dimension.getJoinChains()) { xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc)); } return xd; }
path1.getEdges().getEdge().add(edge1); xj1.getPaths().getPath().add(path1); dimension.getJoinChains().getJoinChain().add(xj1); dimension.getAttributes().getDimAttribute().add(xd3); dimension.getAttributes().getDimAttribute().add(xd4); dimension.getAttributes().getDimAttribute().add(xd5);
/** * 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)); }
public XDimension withName(String value) { setName(value); return this; }
public XDimension withProperties(XProperties value) { setProperties(value); return this; }
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 XDimension xdimensionFromDimension(Dimension dimension) { XDimension xd = XCF.createXDimension(); xd.setName(dimension.getName()); xd.setAttributes(new XDimAttributes()); xd.setExpressions(new XExpressions()); xd.setJoinChains(new XJoinChains()); xd.setProperties(new XProperties()); xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties())); for (CubeDimAttribute cd : dimension.getAttributes()) { xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension)); } for (ExprColumn ec : dimension.getExpressions()) { xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec)); } for (JoinChain jc : dimension.getJoinChains()) { xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc)); } return xd; }
/** * 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)); }
public XDimension withName(String value) { setName(value); return this; }
public XDimension withProperties(XProperties value) { setProperties(value); return this; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { theAttributes = this.getAttributes(); strategy.appendField(locator, this, "attributes", buffer, theAttributes); theExpressions = this.getExpressions(); strategy.appendField(locator, this, "expressions", buffer, theExpressions); theJoinChains = this.getJoinChains(); strategy.appendField(locator, this, "joinChains", buffer, theJoinChains); theProperties = this.getProperties(); strategy.appendField(locator, this, "properties", buffer, theProperties); theName = this.getName(); strategy.appendField(locator, this, "name", buffer, theName); theDescription = this.getDescription(); strategy.appendField(locator, this, "description", buffer, theDescription);
dimension.setName(dimName); dimension.setAttributes(new XDimAttributes()); dimension.setExpressions(new XExpressions()); dimension.setJoinChains(new XJoinChains()); dimension.setProperties(new XProperties().withProperty( new XProperty().withName(MetastoreUtil.getDimTimedDimensionKey(dimName)).withValue("dt")) ); dimension.getAttributes().getDimAttribute().add(xd1); dimension.getAttributes().getDimAttribute().add(xd2); es.setExpr("substr(col1, 3)"); xe1.getExprSpec().add(es); dimension.getExpressions().getExpression().add(xe1); dimension.getProperties().getProperty().add(xp1); return dimension;
@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 XDimension withJoinChains(XJoinChains value) { setJoinChains(value); return this; }
public XDimension withAttributes(XDimAttributes value) { setAttributes(value); return this; }
public XDimension withExpressions(XExpressions value) { setExpressions(value); return this; }