public XExpressions withExpression(Collection<XExprColumn> values) { if (values!= null) { getExpression().addAll(values); } return this; }
public XExpressions withExpression(XExprColumn... values) { if (values!= null) { for (XExprColumn value: values) { getExpression().add(value); } } return this; }
public XExpressions withExpression(Collection<XExprColumn> values) { if (values!= null) { getExpression().addAll(values); } return this; }
public XExpressions withExpression(XExprColumn... values) { if (values!= null) { for (XExprColumn value: values) { getExpression().add(value); } } return this; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { List<XExprColumn> theExpression; theExpression = (((this.expression!= null)&&(!this.expression.isEmpty()))?this.getExpression():null); strategy.appendField(locator, this, "expression", buffer, theExpression); } return buffer; }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { List<XExprColumn> theExpression; theExpression = (((this.expression!= null)&&(!this.expression.isEmpty()))?this.getExpression():null); strategy.appendField(locator, this, "expression", buffer, theExpression); } return buffer; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<XExprColumn> theExpression; theExpression = (((this.expression!= null)&&(!this.expression.isEmpty()))?this.getExpression():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "expression", theExpression), currentHashCode, theExpression); } return currentHashCode; }
public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { int currentHashCode = 1; { List<XExprColumn> theExpression; theExpression = (((this.expression!= null)&&(!this.expression.isEmpty()))?this.getExpression():null); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "expression", theExpression), currentHashCode, theExpression); } return currentHashCode; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof XExpressions)) { return false; } if (this == object) { return true; } final XExpressions that = ((XExpressions) object); { List<XExprColumn> lhsExpression; lhsExpression = (((this.expression!= null)&&(!this.expression.isEmpty()))?this.getExpression():null); List<XExprColumn> rhsExpression; rhsExpression = (((that.expression!= null)&&(!that.expression.isEmpty()))?that.getExpression():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "expression", lhsExpression), LocatorUtils.property(thatLocator, "expression", rhsExpression), lhsExpression, rhsExpression)) { return false; } } return true; }
public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { if (!(object instanceof XExpressions)) { return false; } if (this == object) { return true; } final XExpressions that = ((XExpressions) object); { List<XExprColumn> lhsExpression; lhsExpression = (((this.expression!= null)&&(!this.expression.isEmpty()))?this.getExpression():null); List<XExprColumn> rhsExpression; rhsExpression = (((that.expression!= null)&&(!that.expression.isEmpty()))?that.getExpression():null); if (!strategy.equals(LocatorUtils.property(thisLocator, "expression", lhsExpression), LocatorUtils.property(thatLocator, "expression", rhsExpression), lhsExpression, rhsExpression)) { return false; } } return true; }
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); }
if (bcube.getExpressions() != null && !bcube.getExpressions().getExpression().isEmpty()) { for (XExprColumn xe : bcube.getExpressions().getExpression()) { expressions.add(hiveExprColumnFromXExprColumn(xe));
if (bcube.getExpressions() != null && !bcube.getExpressions().getExpression().isEmpty()) { for (XExprColumn xe : bcube.getExpressions().getExpression()) { expressions.add(hiveExprColumnFromXExprColumn(xe));
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; }
assertEquals(JAXBUtils.mapFromXProperties(testDim.getProperties()).get("dimension.foo"), "dim.bar"); assertEquals(testDim.getAttributes().getDimAttribute().size(), 5); assertEquals(testDim.getExpressions().getExpression().size(), 1); assertEquals(testDim.getJoinChains().getJoinChain().size(), 1); assertEquals(testDim.getJoinChains().getJoinChain().get(0).getPaths().getPath().size(), 1);
xbc.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec));
xbc.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec));
es.setExpr("substr(col1, 3)"); xe1.getExprSpec().add(es); dimension.getExpressions().getExpression().add(xe1);