/** * @return the timedDimension */ public String getTimedDimension() { return getProperties().get(MetastoreUtil.getDimTimedDimensionKey(getName())); }
/** * @return the timedDimension */ public String getTimedDimension() { return getProperties().get(MetastoreUtil.getDimTimedDimensionKey(getName())); }
/** * Remove the dimension with name specified * * @param attrName */ public void removeAttribute(String attrName) { if (attributeMap.containsKey(attrName.toLowerCase())) { log.info("Removing attribute {}", getAttributeByName(attrName)); attributes.remove(getAttributeByName(attrName)); attributeMap.remove(attrName.toLowerCase()); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getDimAttributeListKey(getName()), attributes); } }
/** * Remove the dimension with name specified * * @param attrName */ public void removeAttribute(String attrName) { if (attributeMap.containsKey(attrName.toLowerCase())) { log.info("Removing attribute {}", getAttributeByName(attrName)); attributes.remove(getAttributeByName(attrName)); attributeMap.remove(attrName.toLowerCase()); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getDimAttributeListKey(getName()), attributes); } }
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); } }
@Override public void addProperties() { super.addProperties(); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getDimAttributeListKey(getName()), attributes); setAttributedProperties(getProperties(), attributes); }
@Override public void addProperties() { super.addProperties(); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getDimAttributeListKey(getName()), attributes); setAttributedProperties(getProperties(), attributes); }
/** * Alters the attribute if already existing or just adds if it is new attribute * * @param attribute */ public void alterAttribute(@NonNull CubeDimAttribute attribute) { // Replace dimension if already existing if (attributeMap.containsKey(attribute.getName().toLowerCase())) { attributes.remove(getAttributeByName(attribute.getName())); log.info("Replacing attribute {} with {}", getAttributeByName(attribute.getName()), attribute); } attributes.add(attribute); attributeMap.put(attribute.getName().toLowerCase(), attribute); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getDimAttributeListKey(getName()), attributes); attribute.addProperties(getProperties()); }
/** * Alters the attribute if already existing or just adds if it is new attribute * * @param attribute */ public void alterAttribute(@NonNull CubeDimAttribute attribute) { // Replace dimension if already existing if (attributeMap.containsKey(attribute.getName().toLowerCase())) { attributes.remove(getAttributeByName(attribute.getName())); log.info("Replacing attribute {} with {}", getAttributeByName(attribute.getName()), attribute); } attributes.add(attribute); attributeMap.put(attribute.getName().toLowerCase(), attribute); MetastoreUtil.addNameStrings(getProperties(), MetastoreUtil.getDimAttributeListKey(getName()), attributes); attribute.addProperties(getProperties()); }
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(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); } }
null, null, null)); toAlter.removeAttribute("f1"); toAlter.getProperties().put("alter.prop", "altered"); toAlter.alterExpression(new ExprColumn(new FieldSchema("formattedcode", "string", "formatted zipcode"), "Formatted zipcode", "format_number(code, \"#,###,###\")")); assertEquals(stateid.getDisplayString(), "State refer altered"); assertEquals(altered.getProperties().get("alter.prop"), "altered");