本文整理了Java中org.apache.hadoop.hive.common.FileUtils.makeDefaultListBucketingDirName()
方法的一些代码示例,展示了FileUtils.makeDefaultListBucketingDirName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.makeDefaultListBucketingDirName()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.common.FileUtils
类名称:FileUtils
方法名:makeDefaultListBucketingDirName
[英]default directory will have the same depth as number of skewed columns this will make future operation easy like DML merge, concatenate merge
[中]默认目录将具有与倾斜列数相同的深度,这将使将来的操作更容易,如DML合并、连接合并
代码示例来源:origin: apache/hive
private String createDefaultLbDir(List<String> skewedCols,
Map<List<String>, String> locationMap) {
String lbDirName;
lbDirName = FileUtils.makeDefaultListBucketingDirName(skewedCols,
lbCtx.getDefaultDirName());
List<String> defaultKey = Lists.newArrayList(lbCtx.getDefaultKey());
if (!locationMap.containsKey(defaultKey)) {
locationMap.put(defaultKey, lbDirName);
}
return lbDirName;
}
代码示例来源:origin: apache/hive
/**
* Decide whether should select the default directory.
*
* @param part
* @param selectedPaths
* @param nonSkewedValueMatchResult
*/
private static void decideDefaultDirSelection(Partition part, List<Path> selectedPaths,
List<Boolean> nonSkewedValueMatchResult) {
boolean skipDefDir = true;
for (Boolean v : nonSkewedValueMatchResult) {
if ((v == null) || v) {
skipDefDir = false; // we skip default directory only if all value is false
break;
}
}
if (!skipDefDir) {
StringBuilder builder = new StringBuilder();
builder.append(part.getLocation());
builder.append(Path.SEPARATOR);
builder
.append((FileUtils.makeDefaultListBucketingDirName(
part.getSkewedColNames(),
ListBucketingPrunerUtils.HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME)));
selectedPaths.add(new Path(builder.toString()));
}
}
代码示例来源:origin: apache/hive
/**
* Calculate skewed value subdirectory directory which is used in
* FileSinkOperator.java createKeyForStatsPublisher()
* For example, create table test skewed by (key, value) on (('484','val_484')
* stored as DIRECTORIES;
* after the method, skewedValuesDirNames will contain 2 elements:
* key=484/value=val_484
* HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME/HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME
*/
public void calculateSkewedValueSubDirList() {
if (isSkewedStoredAsDir()) {
for (List<String> value : this.skewedColValues) {
skewedValuesDirNames.add(FileUtils.makeListBucketingDirName(this.skewedColNames, value));
}
// creat default dir
skewedValuesDirNames.add(FileUtils.makeDefaultListBucketingDirName(
this.skewedColNames,
ListBucketingPrunerUtils.HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME));
}
}
代码示例来源:origin: apache/drill
/**
* Decide whether should select the default directory.
*
* @param part
* @param selectedPaths
* @param nonSkewedValueMatchResult
*/
private static void decideDefaultDirSelection(Partition part, List<Path> selectedPaths,
List<Boolean> nonSkewedValueMatchResult) {
boolean skipDefDir = true;
for (Boolean v : nonSkewedValueMatchResult) {
if ((v == null) || v) {
skipDefDir = false; // we skip default directory only if all value is false
break;
}
}
if (!skipDefDir) {
StringBuilder builder = new StringBuilder();
builder.append(part.getLocation());
builder.append(Path.SEPARATOR);
builder
.append((FileUtils.makeDefaultListBucketingDirName(
part.getSkewedColNames(),
ListBucketingPrunerUtils.HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME)));
selectedPaths.add(new Path(builder.toString()));
}
}
代码示例来源:origin: apache/drill
/**
* Calculate skewed value subdirectory directory which is used in
* FileSinkOperator.java createKeyForStatsPublisher()
* For example, create table test skewed by (key, value) on (('484','val_484')
* stored as DIRECTORIES;
* after the method, skewedValuesDirNames will contain 2 elements:
* key=484/value=val_484
* HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME/HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME
*/
public void calculateSkewedValueSubDirList() {
if (isSkewedStoredAsDir()) {
for (List<String> value : this.skewedColValues) {
skewedValuesDirNames.add(FileUtils.makeListBucketingDirName(this.skewedColNames, value));
}
// creat default dir
skewedValuesDirNames.add(FileUtils.makeDefaultListBucketingDirName(
this.skewedColNames,
ListBucketingPrunerUtils.HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME));
}
}
代码示例来源:origin: apache/drill
} else {
lbDirName = FileUtils.makeDefaultListBucketingDirName(skewedCols,
lbCtx.getDefaultDirName());
List<String> defaultKey = Lists.newArrayList(lbCtx.getDefaultKey());
代码示例来源:origin: com.facebook.presto.hive/hive-apache
/**
* Decide whether should select the default directory.
*
* @param part
* @param selectedPaths
* @param nonSkewedValueMatchResult
*/
private static void decideDefaultDirSelection(Partition part, List<Path> selectedPaths,
List<Boolean> nonSkewedValueMatchResult) {
boolean skipDefDir = true;
for (Boolean v : nonSkewedValueMatchResult) {
if ((v == null) || v) {
skipDefDir = false; // we skip default directory only if all value is false
break;
}
}
if (!skipDefDir) {
StringBuilder builder = new StringBuilder();
builder.append(part.getLocation());
builder.append(Path.SEPARATOR);
builder
.append((FileUtils.makeDefaultListBucketingDirName(
part.getSkewedColNames(),
ListBucketingPrunerUtils.HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME)));
selectedPaths.add(new Path(builder.toString()));
}
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
/**
* Calculate skewed value subdirectory directory which is used in
* FileSinkOperator.java createKeyForStatsPublisher()
* For example, create table test skewed by (key, value) on (('484','val_484')
* stored as DIRECTORIES;
* after the method, skewedValuesDirNames will contain 2 elements:
* key=484/value=val_484
* HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME/HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME
*/
public void calculateSkewedValueSubDirList() {
if (isSkewedStoredAsDir()) {
for (List<String> value : this.skewedColValues) {
skewedValuesDirNames.add(FileUtils.makeListBucketingDirName(this.skewedColNames, value));
}
// creat default dir
skewedValuesDirNames.add(FileUtils.makeDefaultListBucketingDirName(
this.skewedColNames,
ListBucketingPrunerUtils.HIVE_LIST_BUCKETING_DEFAULT_DIR_NAME));
}
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
} else {
lbDirName = FileUtils.makeDefaultListBucketingDirName(skewedCols,
lbCtx.getDefaultDirName());
List<String> defaultKey = Arrays.asList(lbCtx.getDefaultKey());
内容来源于网络,如有侵权,请联系作者删除!