public Set<String> getJoinChainNames() { Set<String> chainNames = new HashSet<>(); for (JoinChain f : getJoinChains()) { chainNames.add(f.getName().toLowerCase()); } return chainNames; }
public Set<String> getJoinChainNames() { Set<String> chainNames = new HashSet<>(); for (JoinChain f : getJoinChains()) { chainNames.add(f.getName().toLowerCase()); } return chainNames; }
public void addProperties(Dimension dimension) { Map<String, String> props = dimension.getProperties(); props.put(MetastoreUtil.getDimensionJoinChainNumChainsKey(getName()), String.valueOf(paths.size())); for (int i = 0; i < paths.size(); i++) { props.put(MetastoreUtil.getDimensionJoinChainFullChainKey(getName(), i), MetastoreUtil.getReferencesString(paths.get(i).getReferences())); } if (displayString != null) { props.put(MetastoreUtil.getDimensionJoinChainDisplayKey(getName()), displayString); } if (description != null) { props.put(MetastoreUtil.getDimensionJoinChainDescriptionKey(getName()), description); } }
public AbstractBaseTable(String name, Set<ExprColumn> exprs, Set<JoinChain> joinChains, Map<String, String> properties, double weight) { super(name, COLUMNS, properties, weight); exprMap = new HashMap<>(); if (exprs == null) { this.expressions = new HashSet<>(); } else { this.expressions = exprs; } for (ExprColumn expr : expressions) { exprMap.put(expr.getName().toLowerCase(), expr); } if (joinChains != null) { this.joinChains = joinChains; } else { this.joinChains = new HashSet<>(); } chainMap = new HashMap<>(); for (JoinChain chain : this.joinChains) { chainMap.put(chain.getName().toLowerCase(), chain); } }
public void addProperties(Cube cube) { Map<String, String> props = cube.getProperties(); props.put(MetastoreUtil.getCubeJoinChainNumChainsKey(getName()), String.valueOf(paths.size())); for (int i = 0; i < paths.size(); i++) { props.put(MetastoreUtil.getCubeJoinChainFullChainKey(getName(), i), MetastoreUtil.getReferencesString(paths.get(i).getReferences())); } if (displayString != null) { props.put(MetastoreUtil.getCubeJoinChainDisplayKey(getName()), displayString); } if (description != null) { props.put(MetastoreUtil.getCubeJoinChainDescriptionKey(getName()), description); } }
public void addProperties(Dimension dimension) { Map<String, String> props = dimension.getProperties(); props.put(MetastoreUtil.getDimensionJoinChainNumChainsKey(getName()), String.valueOf(paths.size())); for (int i = 0; i < paths.size(); i++) { props.put(MetastoreUtil.getDimensionJoinChainFullChainKey(getName(), i), MetastoreUtil.getReferencesString(paths.get(i).getReferences())); } if (displayString != null) { props.put(MetastoreUtil.getDimensionJoinChainDisplayKey(getName()), displayString); } if (description != null) { props.put(MetastoreUtil.getDimensionJoinChainDescriptionKey(getName()), description); } }
public void addProperties(Cube cube) { Map<String, String> props = cube.getProperties(); props.put(MetastoreUtil.getCubeJoinChainNumChainsKey(getName()), String.valueOf(paths.size())); for (int i = 0; i < paths.size(); i++) { props.put(MetastoreUtil.getCubeJoinChainFullChainKey(getName(), i), MetastoreUtil.getReferencesString(paths.get(i).getReferences())); } if (displayString != null) { props.put(MetastoreUtil.getCubeJoinChainDisplayKey(getName()), displayString); } if (description != null) { props.put(MetastoreUtil.getCubeJoinChainDescriptionKey(getName()), description); } }
public AbstractBaseTable(String name, Set<ExprColumn> exprs, Set<JoinChain> joinChains, Map<String, String> properties, double weight) { super(name, COLUMNS, properties, weight); exprMap = new HashMap<>(); if (exprs == null) { this.expressions = new HashSet<>(); } else { this.expressions = exprs; } for (ExprColumn expr : expressions) { exprMap.put(expr.getName().toLowerCase(), expr); } if (joinChains != null) { this.joinChains = joinChains; } else { this.joinChains = new HashSet<>(); } chainMap = new HashMap<>(); for (JoinChain chain : this.joinChains) { chainMap.put(chain.getName().toLowerCase(), chain); } }
/** * Alters the joinchain if already existing or just adds if it is new chain * * @param joinchain join chain */ public void alterJoinChain(JoinChain joinchain) { if (joinchain == null) { throw new NullPointerException("Cannot add null joinchain"); } // Replace dimension if already existing if (chainMap.containsKey(joinchain.getName().toLowerCase())) { joinChains.remove(getChainByName(joinchain.getName())); log.info("Replacing joinchain {} with {}", getChainByName(joinchain.getName()), joinchain); } joinChains.add(joinchain); chainMap.put(joinchain.getName().toLowerCase(), joinchain); MetastoreUtil.addNameStrings(getProperties(), getJoinChainListPropKey(getName()), joinChains); joinchain.addProperties(this); }
/** * Alters the joinchain if already existing or just adds if it is new chain * * @param joinchain join chain */ public void alterJoinChain(JoinChain joinchain) { if (joinchain == null) { throw new NullPointerException("Cannot add null joinchain"); } // Replace dimension if already existing if (chainMap.containsKey(joinchain.getName().toLowerCase())) { joinChains.remove(getChainByName(joinchain.getName())); log.info("Replacing joinchain {} with {}", getChainByName(joinchain.getName()), joinchain); } joinChains.add(joinchain); chainMap.put(joinchain.getName().toLowerCase(), joinchain); MetastoreUtil.addNameStrings(getProperties(), getJoinChainListPropKey(getName()), joinChains); joinchain.addProperties(this); }
private void addAllChainedColsToFlattenedList(CubeMetastoreClient client, ObjectFactory objectFactory, AbstractBaseTable baseTbl, List<XFlattenedColumn> columnList) throws HiveException, LensException { for (JoinChain chain : baseTbl.getJoinChains()) { Dimension dim = client.getDimension(chain.getDestTable()); addAllDirectAttributesToFlattenedListFromDimension(objectFactory, dim, columnList, chain.getName()); addAllDirectExpressionsToFlattenedList(objectFactory, dim, columnList, chain.getName()); } }
public AbstractBaseTable(Table tbl) { super(tbl); this.expressions = getExpressions(getName(), getProperties()); exprMap = new HashMap<>(); for (ExprColumn expr : expressions) { exprMap.put(expr.getName().toLowerCase(), expr); } this.joinChains = getJoinChains(this, getJoinChainListPropKey(getName()), getProperties()); chainMap = new HashMap<>(); for (JoinChain chain : joinChains) { chainMap.put(chain.getName().toLowerCase(), chain); } }
public AbstractBaseTable(Table tbl) { super(tbl); this.expressions = getExpressions(getName(), getProperties()); exprMap = new HashMap<>(); for (ExprColumn expr : expressions) { exprMap.put(expr.getName().toLowerCase(), expr); } this.joinChains = getJoinChains(this, getJoinChainListPropKey(getName()), getProperties()); chainMap = new HashMap<>(); for (JoinChain chain : joinChains) { chainMap.put(chain.getName().toLowerCase(), chain); } }
numChains = Integer.parseInt(props.get(MetastoreUtil.getCubeJoinChainNumChainsKey(getName()))); } else { numChains = Integer.parseInt(props.get(MetastoreUtil.getDimensionJoinChainNumChainsKey(getName()))); String refListStr; if (isCube) { refListStr = props.get(MetastoreUtil.getCubeJoinChainFullChainKey(getName(), i)); } else { refListStr = props.get(MetastoreUtil.getDimensionJoinChainFullChainKey(getName(), i));
numChains = Integer.parseInt(props.get(MetastoreUtil.getCubeJoinChainNumChainsKey(getName()))); } else { numChains = Integer.parseInt(props.get(MetastoreUtil.getDimensionJoinChainNumChainsKey(getName()))); String refListStr; if (isCube) { refListStr = props.get(MetastoreUtil.getCubeJoinChainFullChainKey(getName(), i)); } else { refListStr = props.get(MetastoreUtil.getDimensionJoinChainFullChainKey(getName(), i));
Aliased<Dimension> aliasedDimension = Aliased.create(dimension, chain.getName()); multipleJoinPaths.computeIfAbsent(aliasedDimension, k -> new ArrayList<>()) .addAll(chain.getRelationEdges(cubeql.getMetastoreClient()));
Aliased<Dimension> aliasedDimension = Aliased.create(dimension, chain.getName()); multipleJoinPaths.computeIfAbsent(aliasedDimension, k -> new ArrayList<>()) .addAll(chain.getRelationEdges(cubeql.getMetastoreClient()));
/** * Create XJoinChain from cube join chain */ public static XJoinChain getXJoinChainFromJoinChain(JoinChain jc) { XJoinChain xjc = XCF.createXJoinChain(); xjc.setName(jc.getName()); xjc.setDescription(jc.getDescription()); xjc.setDisplayString(jc.getDisplayString()); xjc.setDestTable(jc.getDestTable()); xjc.setPaths(new XJoinPaths()); for (JoinChain.Path path : jc.getPaths()) { xjc.getPaths().getPath().add(xJoinPathFromJoinPath(path)); } return xjc; }
/** * Create XJoinChain from cube join chain */ public static XJoinChain getXJoinChainFromJoinChain(JoinChain jc) { XJoinChain xjc = XCF.createXJoinChain(); xjc.setName(jc.getName()); xjc.setDescription(jc.getDescription()); xjc.setDisplayString(jc.getDisplayString()); xjc.setDestTable(jc.getDestTable()); xjc.setPaths(new XJoinPaths()); for (JoinChain.Path path : jc.getPaths()) { xjc.getPaths().getPath().add(xJoinPathFromJoinPath(path)); } return xjc; }