/** * Given a dynamic partition specification, return the path corresponding to the * static part of partition specification. This is basically a copy of makePartName * but we get rid of MetaException since it is not serializable. * @param spec * @return string representation of the static part of the partition specification. */ public static String makeDynamicPartName(Map<String, String> spec) { StringBuilder suffixBuf = new StringBuilder(); for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() != null && e.getValue().length() > 0) { suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); suffixBuf.append(Path.SEPARATOR); } else { // stop once we see a dynamic partition break; } } return suffixBuf.toString(); }
private static String makePartExpr(Map<String, String> spec) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; for (Map.Entry<String, String> e : spec.entrySet()) { if (e.getValue() == null || e.getValue().length() == 0) { throw new MetaException("Partition spec is incorrect. " + spec); } if (i > 0) { suffixBuf.append(" AND "); } suffixBuf.append(Warehouse.escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append("'").append(Warehouse.escapePathName(e.getValue())).append("'"); i++; } return suffixBuf.toString(); }
/** * Makes a partition name from a specification * @param spec * @param addTrailingSeperator if true, adds a trailing separator e.g. 'ds=1/' * @return partition name * @throws MetaException */ public static String makePartName(Map<String, String> spec, boolean addTrailingSeperator) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() == null || e.getValue().length() == 0) { throw new MetaException("Partition spec is incorrect. " + spec); } if (i>0) { suffixBuf.append(Path.SEPARATOR); } suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); i++; } if (addTrailingSeperator) { suffixBuf.append(Path.SEPARATOR); } return suffixBuf.toString(); } /**
/** * Given a dynamic partition specification, return the path corresponding to the * static part of partition specification. This is basically a copy of makePartName * but we get rid of MetaException since it is not serializable. * @param spec * @return string representation of the static part of the partition specification. */ public static String makeDynamicPartName(Map<String, String> spec) { StringBuilder suffixBuf = new StringBuilder(); for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() != null && e.getValue().length() > 0) { suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); suffixBuf.append(Path.SEPARATOR); } else { // stop once we see a dynamic partition break; } } return suffixBuf.toString(); }
/** * Given a dynamic partition specification, return the path corresponding to the * static part of partition specification. This is basically a copy of makePartName * but we get rid of MetaException since it is not serializable. * @param spec * @return string representation of the static part of the partition specification. */ public static String makeDynamicPartName(Map<String, String> spec) { StringBuilder suffixBuf = new StringBuilder(); for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() != null && e.getValue().length() > 0) { suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); suffixBuf.append(Path.SEPARATOR); } else { // stop once we see a dynamic partition break; } } return suffixBuf.toString(); }
/** * Given a dynamic partition specification, return the path corresponding to the * static part of partition specification. This is basically a copy of makePartName * but we get rid of MetaException since it is not serializable. * @param spec * @return string representation of the static part of the partition specification. */ public static String makeDynamicPartName(Map<String, String> spec) { StringBuilder suffixBuf = new StringBuilder(); for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() != null && e.getValue().length() > 0) { suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); suffixBuf.append(Path.SEPARATOR); } else { // stop once we see a dynamic partition break; } } return suffixBuf.toString(); }
/** * Given a dynamic partition specification, return the path corresponding to the * static part of partition specification. This is basically a copy of makePartName * but we get rid of MetaException since it is not serializable. * @param spec * @return string representation of the static part of the partition specification. */ public static String makeDynamicPartName(Map<String, String> spec) { StringBuilder suffixBuf = new StringBuilder(); for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() != null && e.getValue().length() > 0) { suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); suffixBuf.append(Path.SEPARATOR); } else { // stop once we see a dynamic partition break; } } return suffixBuf.toString(); }
/** * Given a dynamic partition specification, return the path corresponding to the * static part of partition specification. This is basically a copy of makePartName * but we get rid of MetaException since it is not serializable. * @param spec * @return string representation of the static part of the partition specification. */ public static String makeDynamicPartName(Map<String, String> spec) { StringBuilder suffixBuf = new StringBuilder(); for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() != null && e.getValue().length() > 0) { suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); suffixBuf.append(Path.SEPARATOR); } else { // stop once we see a dynamic partition break; } } return suffixBuf.toString(); }
/** * Makes a partition name from a specification * @param spec * @param addTrailingSeperator if true, adds a trailing separator e.g. 'ds=1/' * @return partition name * @throws MetaException */ public static String makePartName(Map<String, String> spec, boolean addTrailingSeperator) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() == null || e.getValue().length() == 0) { throw new MetaException("Partition spec is incorrect. " + spec); } if (i>0) { suffixBuf.append(Path.SEPARATOR); } suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); i++; } if (addTrailingSeperator) { suffixBuf.append(Path.SEPARATOR); } return suffixBuf.toString(); } /**
/** * Makes a partition name from a specification * @param spec * @param addTrailingSeperator if true, adds a trailing separator e.g. 'ds=1/' * @return partition name * @throws MetaException */ public static String makePartName(Map<String, String> spec, boolean addTrailingSeperator) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() == null || e.getValue().length() == 0) { throw new MetaException("Partition spec is incorrect. " + spec); } if (i>0) { suffixBuf.append(Path.SEPARATOR); } suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); i++; } if (addTrailingSeperator) { suffixBuf.append(Path.SEPARATOR); } return suffixBuf.toString(); } /**
/** * Makes a partition name from a specification * @param spec * @param addTrailingSeperator if true, adds a trailing separator e.g. 'ds=1/' * @return partition name * @throws MetaException */ public static String makePartName(Map<String, String> spec, boolean addTrailingSeperator) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() == null || e.getValue().length() == 0) { throw new MetaException("Partition spec is incorrect. " + spec); } if (i>0) { suffixBuf.append(Path.SEPARATOR); } suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); i++; } if (addTrailingSeperator) { suffixBuf.append(Path.SEPARATOR); } return suffixBuf.toString(); } /**
/** * Makes a partition name from a specification * @param spec * @param addTrailingSeperator if true, adds a trailing separator e.g. 'ds=1/' * @return partition name * @throws MetaException */ public static String makePartName(Map<String, String> spec, boolean addTrailingSeperator) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() == null || e.getValue().length() == 0) { throw new MetaException("Partition spec is incorrect. " + spec); } if (i>0) { suffixBuf.append(Path.SEPARATOR); } suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); i++; } if (addTrailingSeperator) { suffixBuf.append(Path.SEPARATOR); } return suffixBuf.toString(); } /**
/** * Makes a partition name from a specification * @param spec * @param addTrailingSeperator if true, adds a trailing separator e.g. 'ds=1/' * @return * @throws MetaException */ public static String makePartName(Map<String, String> spec, boolean addTrailingSeperator) throws MetaException { StringBuilder suffixBuf = new StringBuilder(); int i = 0; for (Entry<String, String> e : spec.entrySet()) { if (e.getValue() == null || e.getValue().length() == 0) { throw new MetaException("Partition spec is incorrect. " + spec); } if (i>0) { suffixBuf.append(Path.SEPARATOR); } suffixBuf.append(escapePathName(e.getKey())); suffixBuf.append('='); suffixBuf.append(escapePathName(e.getValue())); i++; } if (addTrailingSeperator) { suffixBuf.append(Path.SEPARATOR); } return suffixBuf.toString(); } /**