public Set<String> getAttributeNames() { Set<String> dimNames = new HashSet<String>(); for (CubeDimAttribute f : getAttributes()) { MetastoreUtil.addColumnNames(f, dimNames); } return dimNames; }
public Set<String> getAttributeNames() { Set<String> dimNames = new HashSet<String>(); for (CubeDimAttribute f : getAttributes()) { MetastoreUtil.addColumnNames(f, dimNames); } return dimNames; }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } Dimension other = (Dimension) obj; if (this.getAttributes() == null) { if (other.getAttributes() != null) { return false; } } else if (!this.getAttributes().equals(other.getAttributes())) { return false; } if (this.getJoinChains() == null) { if (other.getJoinChains() != null) { return false; } } else if (!this.getJoinChains().equals(other.getJoinChains())) { return false; } return true; }
@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } Dimension other = (Dimension) obj; if (this.getAttributes() == null) { if (other.getAttributes() != null) { return false; } } else if (!this.getAttributes().equals(other.getAttributes())) { return false; } if (this.getJoinChains() == null) { if (other.getJoinChains() != null) { return false; } } else if (!this.getJoinChains().equals(other.getJoinChains())) { return false; } return true; }
public Dimension(Table tbl) { super(tbl); this.attributes = getAttributes(getName(), getProperties()); attributeMap = new HashMap<>(); for (CubeDimAttribute attr : attributes) { addAllAttributesToMap(attr); } }
public Dimension(Table tbl) { super(tbl); this.attributes = getAttributes(getName(), getProperties()); attributeMap = new HashMap<>(); for (CubeDimAttribute attr : attributes) { addAllAttributesToMap(attr); } }
private void addAllDirectAttributesToFlattenedListFromDimension(ObjectFactory objectFactory, Dimension dimension, List<XFlattenedColumn> columnList, String chainName) { for (CubeDimAttribute cd : dimension.getAttributes()) { XFlattenedColumn fcol = objectFactory.createXFlattenedColumn(); fcol.setDimAttribute(JAXBUtils.xDimAttrFromHiveDimAttr(cd, dimension)); fcol.setTableName(dimension.getName()); if (chainName != null) { fcol.setChainName(chainName); } columnList.add(fcol); } }
private void validateDim(Dimension udim, Set<CubeDimAttribute> attrs, String basedim, String referdim) throws HiveException, LensException { assertTrue(client.tableExists(udim.getName())); Table dimTbl = client.getHiveTable(udim.getName()); assertTrue(client.isDimension(dimTbl)); Dimension dim = new Dimension(dimTbl); assertTrue(udim.equals(dim), "Equals failed for " + dim.getName()); assertTrue(udim.equals(client.getDimension(udim.getName()))); assertEquals(dim.getAttributes().size(), attrs.size()); assertNotNull(dim.getAttributeByName(basedim)); assertTrue(dim.getAttributeByName(basedim) instanceof BaseDimAttribute); if (referdim != null) { assertNotNull(dim.getAttributeByName(referdim)); assertTrue(dim.getAttributeByName(referdim) instanceof ReferencedDimAttribute); } assertEquals(udim.getAttributeNames().size() + udim.getExpressionNames().size(), dim.getAllFieldNames().size()); }
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; }
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; }