/** * This is used only for serializing * * @param name attribute name * @param props Properties */ public ReferencedDimAttribute(String name, Map<String, String> props) throws LensException { super(name, props); String chNamesStr = props.get(MetastoreUtil.getDimRefChainNameKey(getName())); if (!StringUtils.isBlank(chNamesStr)) { String refColsStr = props.get(MetastoreUtil.getDimRefChainColumnKey(getName())); String[] chainNames = StringUtils.split(chNamesStr, ","); String[] refCols = StringUtils.split(refColsStr, ","); for (int i = 0; i < chainNames.length; i++) { chainRefColumns.add(new ChainRefCol(chainNames[i], refCols[i])); } } else { throw new LensException( LensCubeErrorCode.ERROR_IN_ENTITY_DEFINITION.getLensErrorInfo(), " Ref column: " + getName() + " does not have any chain_ref_column defined"); } }
public ReferencedDimAttribute( FieldSchema column, String displayString, List<ChainRefCol> chainRefCols, Date startTime, Date endTime, Double cost, Long numOfDistinctValues, List<String> values) throws LensException { super(column, displayString, startTime, endTime, cost, numOfDistinctValues, values); if (chainRefCols.isEmpty()) { throw new LensException( LensCubeErrorCode.ERROR_IN_ENTITY_DEFINITION.getLensErrorInfo(), " Ref column: " + getName() + " does not have any chain_ref_column defined"); } chainRefColumns.addAll(chainRefCols); }