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

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

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

FileUtils.needsEscaping介绍

暂无

代码示例

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

for (int i = 0; i < path.length(); i++) {
 char c = path.charAt(i);
 if (needsEscaping(c)) {
  sb.append('%');
  sb.append(String.format("%1$02X", (int) c));

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

public static String escapePathName(String path) {
 // __HIVE_DEFAULT_NULL__ is the system default value for null and empty string. We should
 // TODO: we should allow user to specify default partition or HDFS file location.
 if (path == null || path.length() == 0) {
  return "__HIVE_DEFAULT_PARTITION__";
 }
 StringBuilder sb = new StringBuilder();
 for (int i = 0; i < path.length(); i++) {
  char c = path.charAt(i);
  if (needsEscaping(c)) {
   sb.append('%');
   sb.append(String.format("%1$02X", (int) c));
  } else {
   sb.append(c);
  }
 }
 return sb.toString();
}

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

for (int i = 0; i < path.length(); i++) {
 char c = path.charAt(i);
 if (needsEscaping(c)) {
  sb.append('%');
  sb.append(String.format("%1$02X", (int) c));

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

for (int i = 0; i < path.length(); i++) {
 char c = path.charAt(i);
 if (needsEscaping(c)) {
  sb.append('%');
  sb.append(String.format("%1$02X", (int) c));

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

for (int i = 0; i < path.length(); i++) {
 char c = path.charAt(i);
 if (needsEscaping(c)) {
  sb.append('%');
  sb.append(String.format("%1$02X", (int) c));

相关文章