org.apache.hadoop.hive.common.FileUtils.escapePathName()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.apache.hadoop.hive.common.FileUtils.escapePathName()方法的一些代码示例,展示了FileUtils.escapePathName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.escapePathName()方法的具体详情如下:
包路径:org.apache.hadoop.hive.common.FileUtils
类名称:FileUtils
方法名:escapePathName

FileUtils.escapePathName介绍

[英]Escapes a path name.
[中]转义路径名。

代码示例

代码示例来源:origin: apache/hive

public static String escapePathName(String path) {
 return escapePathName(path, null);
}

代码示例来源:origin: apache/hive

private Path constructPartialPartPath(Path partialPath, String partKey, Map<String, String> partKVs) {
 StringBuilder sb = new StringBuilder(FileUtils.escapePathName(partKey));
 sb.append("=");
 sb.append(FileUtils.escapePathName(partKVs.get(partKey)));
 return new Path(partialPath, sb.toString());
}

代码示例来源:origin: apache/hive

/**
 * Makes a valid list bucketing directory name.
 * @param lbCols The skewed keys' names
 * @param vals The skewed values
 * @return An escaped, valid list bucketing directory name.
 */
public static String makeListBucketingDirName(List<String> lbCols, List<String> vals) {
 StringBuilder name = new StringBuilder();
 for (int i = 0; i < lbCols.size(); i++) {
  if (i > 0) {
   name.append(Path.SEPARATOR);
  }
  name.append(escapePathName((lbCols.get(i)).toLowerCase()));
  name.append('=');
  name.append(escapePathName(vals.get(i)));
 }
 return name.toString();
}

代码示例来源:origin: apache/hive

private String prependPartSpec(String inputPath, String fileName) {
 Map<String, String> mapping = inputToPartSpecMapping == null ?
   inputToPartSpecMapping = revert(bigTablePartSpecToFileMapping) : inputToPartSpecMapping;
 String partSpec = mapping.get(URI.create(inputPath).getPath());
 return partSpec == null || partSpec.isEmpty() ? fileName :
  "(" + FileUtils.escapePathName(partSpec) + ")" + fileName;
}

代码示例来源:origin: apache/hive

/**
 * Makes a valid partition name.
 * @param partCols The partition keys' names
 * @param vals The partition values
 * @param defaultStr
 *         The default name given to a partition value if the respective value is empty or null.
 * @return An escaped, valid partition name.
 */
public static String makePartName(List<String> partCols, List<String> vals,
  String defaultStr) {
 StringBuilder name = new StringBuilder();
 for (int i = 0; i < partCols.size(); i++) {
  if (i > 0) {
   name.append(Path.SEPARATOR);
  }
  name.append(escapePathName((partCols.get(i)).toLowerCase(), defaultStr));
  name.append('=');
  name.append(escapePathName(vals.get(i), defaultStr));
 }
 return name.toString();
}

代码示例来源:origin: apache/hive

/**
 * default directory will have the same depth as number of skewed columns
 * this will make future operation easy like DML merge, concatenate merge
 * @param skewedCols
 * @param name
 * @return
 */
public static String makeDefaultListBucketingDirName(List<String> skewedCols,
  String name) {
 String lbDirName;
 String defaultDir = FileUtils.escapePathName(name);
 StringBuilder defaultDirPath = new StringBuilder();
 for (int i = 0; i < skewedCols.size(); i++) {
  if (i > 0) {
   defaultDirPath.append(Path.SEPARATOR);
  }
  defaultDirPath.append(defaultDir);
 }
 lbDirName = defaultDirPath.toString();
 return lbDirName;
}

代码示例来源:origin: apache/drill

private String prependPartSpec(String inputPath, String fileName) {
 Map<String, String> mapping = inputToPartSpecMapping == null ?
   inputToPartSpecMapping = revert(bigTablePartSpecToFileMapping) : inputToPartSpecMapping;
 String partSpec = mapping.get(URI.create(inputPath).getPath());
 return partSpec == null || partSpec.isEmpty() ? fileName :
  "(" + FileUtils.escapePathName(partSpec) + ")" + fileName;
}

代码示例来源:origin: apache/drill

String escapedPath = FileUtils.escapePathName(val);
assert escapedPath != null;
if (escapedPath.equals(val)) continue;

代码示例来源:origin: org.apache.hive/hive-common

public static String escapePathName(String path) {
 return escapePathName(path, null);
}

代码示例来源:origin: org.spark-project.hive/hive-metastore

static String escapePathName(String path) {
 return FileUtils.escapePathName(path);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

static String escapePathName(String path) {
 return FileUtils.escapePathName(path);
}

代码示例来源:origin: org.apache.hadoop.hive/hive-metastore

static String escapePathName(String path) {
 return FileUtils.escapePathName(path);
}

代码示例来源:origin: edu.berkeley.cs.shark/hive-metastore

static String escapePathName(String path) {
 return FileUtils.escapePathName(path);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

public static String escapePathName(String path) {
 return escapePathName(path, null);
}

代码示例来源:origin: org.spark-project.hive.hcatalog/hive-hcatalog-core

private Path constructPartialPartPath(Path partialPath, String partKey, Map<String, String> partKVs) {
 StringBuilder sb = new StringBuilder(FileUtils.escapePathName(partKey));
 sb.append("=");
 sb.append(FileUtils.escapePathName(partKVs.get(partKey)));
 return new Path(partialPath, sb.toString());
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

private Path constructPartialPartPath(Path partialPath, String partKey, Map<String, String> partKVs) {
 StringBuilder sb = new StringBuilder(FileUtils.escapePathName(partKey));
 sb.append("=");
 sb.append(FileUtils.escapePathName(partKVs.get(partKey)));
 return new Path(partialPath, sb.toString());
}

代码示例来源:origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-core

private Path constructPartialPartPath(Path partialPath, String partKey, Map<String, String> partKVs) {
 StringBuilder sb = new StringBuilder(FileUtils.escapePathName(partKey));
 sb.append("=");
 sb.append(FileUtils.escapePathName(partKVs.get(partKey)));
 return new Path(partialPath, sb.toString());
}

代码示例来源:origin: org.apache.hive.hcatalog/hive-hcatalog-core

private Path constructPartialPartPath(Path partialPath, String partKey, Map<String, String> partKVs) {
 StringBuilder sb = new StringBuilder(FileUtils.escapePathName(partKey));
 sb.append("=");
 sb.append(FileUtils.escapePathName(partKVs.get(partKey)));
 return new Path(partialPath, sb.toString());
}

代码示例来源:origin: org.apache.hadoop.hive/hive-common

public static String makePartName(List<String> partCols, List<String> vals) {
 StringBuilder name = new StringBuilder();
 for (int i = 0; i < partCols.size(); i++) {
  if (i > 0) {
   name.append(Path.SEPARATOR);
  }
  name.append(escapePathName((partCols.get(i)).toLowerCase()));
  name.append('=');
  name.append(escapePathName(vals.get(i)));
 }
 return name.toString();
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

private String prependPartSpec(String inputPath, String fileName) {
 Map<String, String> mapping = inputToPartSpecMapping == null ?
   inputToPartSpecMapping = revert(bigTablePartSpecToFileMapping) : inputToPartSpecMapping;
 String partSpec = mapping.get(URI.create(inputPath).getPath());
 return partSpec == null || partSpec.isEmpty() ? fileName :
  "(" + FileUtils.escapePathName(partSpec) + ")" + fileName;
}

相关文章