/** * Replace a null or empty dataset URN with {@link #DEFAULT_DATASET_URN}, and replaces illegal HDFS * characters with '_'. */ private static String sanitizeDatasetUrn(String datasetUrn) { return Strings.isNullOrEmpty(datasetUrn) ? DEFAULT_DATASET_URN : HadoopUtils.sanitizePath(datasetUrn, "_"); }
/** * Remove illegal HDFS path characters from the given path. Illegal characters will be replaced * with the given substitute. */ public static Path sanitizePath(Path path, String substitute) { return new Path(sanitizePath(path.toString(), substitute)); }
String sanitizedName = HadoopUtils.sanitizePath(field.name(), "_"); String sanitizedValue = HadoopUtils.sanitizePath(record.get(field.name()).toString(), "_"); if (replacePathSeparators) { sanitizedName = sanitizedName.replaceAll(Path.SEPARATOR, "_");