org.apache.hadoop.hive.ql.exec.Utilities.getBucketIdFromFile()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(81)

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

Utilities.getBucketIdFromFile介绍

暂无

代码示例

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

public static int parseSplitBucket(InputSplit split) {
 if (split instanceof FileSplit) {
  return getBucketIdFromFile(((FileSplit) split).getPath().getName());
 }
 // cannot get this for combined splits
 return -1;
}

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

public static int parseSplitBucket(InputSplit split) {
 if (split instanceof FileSplit) {
  return getBucketIdFromFile(((FileSplit) split).getPath().getName());
 }
 // cannot get this for combined splits
 return -1;
}

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

/**
 * mapping from bucket number to bucket path
 */
// TODO: add test case and clean it up
@SuppressWarnings("nls")
public Path getBucketPath(int bucketNum) {
 // Note: this makes assumptions that won't work with MM tables, unions, etc.
 FileStatus srcs[] = getSortedPaths();
 if (srcs == null) {
  return null;
 }
 // Compute bucketid from srcs and return the 1st match.
 for (FileStatus src : srcs) {
  String bucketName = src.getPath().getName();
  String bucketIdStr = Utilities.getBucketFileNameFromPathSubString(bucketName);
  int bucketId = Utilities.getBucketIdFromFile(bucketIdStr);
  if (bucketId == bucketNum) {
   // match, return
   return src.getPath();
  }
 }
 return null;
}

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

int bucketId = Utilities.getBucketIdFromFile(bucketIdStr);
if (bucketId == -1) {
 fallback = true;

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

int bucketId = Utilities.getBucketIdFromFile(bucketIdStr);
LOG.debug("bucket ID for file " + oneSrc.getPath() + " = " + bucketId
+ " for table " + table.getFullyQualifiedName());

相关文章

微信公众号

最新文章

更多

Utilities类方法