/** * Create an instance of {@link XJoinChains } * */ public XJoinChains createXJoinChains() { return new XJoinChains(); }
/** * Create an instance of {@link XJoinChains } * */ public XJoinChains createXJoinChains() { return new XJoinChains(); }
@Override public XJoinChains getAllJoinChains(LensSessionHandle sessionHandle, String tableName) throws LensException { try (SessionContext ignored = new SessionContext(sessionHandle)){ CubeMetastoreClient client = getClient(sessionHandle); Set<JoinChain> chains; if (client.isCube(tableName)) { chains = client.getCube(tableName).getJoinChains(); } else if (client.isDimension(tableName)) { chains = client.getDimension(tableName).getJoinChains(); } else { throw new BadRequestException("Can't get join chains. '" + tableName + "' is neither a cube nor a dimension"); } XJoinChains xJoinChains = new XJoinChains(); List<XJoinChain> joinChains = xJoinChains.getJoinChain(); if (chains != null) { for (JoinChain chain : chains) { joinChains.add(JAXBUtils.getXJoinChainFromJoinChain(chain)); } } return xJoinChains; } }
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; }
xbc.setDimAttributes(new XDimAttributes()); xbc.setExpressions(new XExpressions()); xbc.setJoinChains(new XJoinChains()); xc = xbc; for (CubeMeasure cm : c.getMeasures()) {
xbc.setDimAttributes(new XDimAttributes()); xbc.setExpressions(new XExpressions()); xbc.setJoinChains(new XJoinChains()); xc = xbc; for (CubeMeasure cm : c.getMeasures()) {
dimension.setJoinChains(new XJoinChains()); dimension.setProperties(new XProperties().withProperty( new XProperty().withName(MetastoreUtil.getDimTimedDimensionKey(dimName)).withValue("dt"))
private void testJoinChains(LensDimensionCommands command) { XJoinChains chains = new XJoinChains(); XJoinChain chain1 = new XJoinChain(); chain1.setPaths(new XJoinPaths()); XJoinPath path = new XJoinPath(); path.setEdges(new XJoinEdges()); XJoinEdge edge1 = new XJoinEdge(); XTableReference ref1 = new XTableReference(); ref1.setTable("test_dim"); ref1.setColumn("d2id"); XTableReference ref2 = new XTableReference(); ref2.setTable("test_detail"); ref2.setColumn("id"); edge1.setFrom(ref1); edge1.setTo(ref2); path.getEdges().getEdge().add(edge1); chain1.setName("dim2chain"); chain1.getPaths().getPath().add(path); chain1.setDestTable("test_detail"); chains.getJoinChain().add(chain1); assertEquals(command.showJoinChains("test_dim"), new XJoinChainTable(chains).toString()); }
private void testJoinChains(LensCubeCommands command) { String joinChains = command.showJoinChains("sample_cube"); XJoinChains chains = new XJoinChains(); XJoinChain chain1 = new XJoinChain(); chain1.setPaths(new XJoinPaths()); chains.getJoinChain().add(chain2); chains.getJoinChain().add(chain1); XJoinChains chainsInDiffOrder = new XJoinChains(); chainsInDiffOrder.getJoinChain().add(chain1); chainsInDiffOrder.getJoinChain().add(chain2);
cube.setExpressions(new XExpressions()); cube.setMeasures(new XMeasures()); cube.setJoinChains(new XJoinChains()); cube.setProperties(new XProperties()); XDimAttribute xd1 = cubeObjectFactory.createXDimAttribute();