本文整理了Java中org.apache.hadoop.hive.ql.metadata.Table.getTableSpec()
方法的一些代码示例,展示了Table.getTableSpec()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getTableSpec()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Table
类名称:Table
方法名:getTableSpec
暂无
代码示例来源:origin: apache/hive
public static Set<Partition> getConfirmedPartitionsForScan(TableScanOperator tableScanOp) {
Set<Partition> confirmedPartns = new HashSet<Partition>();
TableSpec tblSpec = tableScanOp.getConf().getTableMetadata().getTableSpec();
if (tblSpec.specType == TableSpec.SpecType.STATIC_PARTITION) {
// static partition
if (tblSpec.partHandle != null) {
confirmedPartns.add(tblSpec.partHandle);
} else {
// partial partition spec has null partHandle
confirmedPartns.addAll(tblSpec.partitions);
}
} else if (tblSpec.specType == TableSpec.SpecType.DYNAMIC_PARTITION) {
// dynamic partition
confirmedPartns.addAll(tblSpec.partitions);
}
return confirmedPartns;
}
代码示例来源:origin: apache/drill
public static Set<Partition> getConfirmedPartitionsForScan(TableScanOperator tableScanOp) {
Set<Partition> confirmedPartns = new HashSet<Partition>();
TableSpec tblSpec = tableScanOp.getConf().getTableMetadata().getTableSpec();
if (tblSpec.specType == TableSpec.SpecType.STATIC_PARTITION) {
// static partition
if (tblSpec.partHandle != null) {
confirmedPartns.add(tblSpec.partHandle);
} else {
// partial partition spec has null partHandle
confirmedPartns.addAll(tblSpec.partitions);
}
} else if (tblSpec.specType == TableSpec.SpecType.DYNAMIC_PARTITION) {
// dynamic partition
confirmedPartns.addAll(tblSpec.partitions);
}
return confirmedPartns;
}
代码示例来源:origin: apache/hive
public static List<String> getPartitionColumns(TableScanOperator tableScanOp) {
TableSpec tblSpec = tableScanOp.getConf().getTableMetadata().getTableSpec();
if (tblSpec.tableHandle.isPartitioned()) {
return new ArrayList<String>(tblSpec.getPartSpec().keySet());
}
return Collections.emptyList();
}
代码示例来源:origin: apache/drill
public static List<String> getPartitionColumns(TableScanOperator tableScanOp) {
TableSpec tblSpec = tableScanOp.getConf().getTableMetadata().getTableSpec();
if (tblSpec.tableHandle.isPartitioned()) {
return new ArrayList<String>(tblSpec.getPartSpec().keySet());
}
return Collections.emptyList();
}
代码示例来源:origin: apache/hive
public void setFooterScan() {
basicStatsNoJobWork = new BasicStatsNoJobWork(table.getTableSpec());
basicStatsNoJobWork.setStatsReliable(getStatsReliable());
footerScan = true;
}
代码示例来源:origin: apache/drill
public static List<Path> getInputPathsForPartialScan(TableScanOperator tableScanOp,
Appendable aggregationKey) throws SemanticException {
List<Path> inputPaths = new ArrayList<Path>();
switch (tableScanOp.getConf().getTableMetadata().getTableSpec().specType) {
case TABLE_ONLY:
inputPaths.add(tableScanOp.getConf().getTableMetadata()
.getTableSpec().tableHandle.getPath());
break;
case STATIC_PARTITION:
Partition part = tableScanOp.getConf().getTableMetadata()
.getTableSpec().partHandle;
try {
aggregationKey.append(Warehouse.makePartPath(part.getSpec()));
} catch (MetaException e) {
throw new SemanticException(ErrorMsg.ANALYZE_TABLE_PARTIALSCAN_AGGKEY.getMsg(
part.getDataLocation().toString() + e.getMessage()));
} catch (IOException e) {
throw new RuntimeException(e);
}
inputPaths.add(part.getDataLocation());
break;
default:
assert false;
}
return inputPaths;
}
代码示例来源:origin: apache/hive
BasicStatsWork statsWork = new BasicStatsWork(tableScan.getConf().getTableMetadata().getTableSpec());
statsWork.setIsExplicitAnalyze(true);
StatsWork columnStatsWork = new StatsWork(table, statsWork, parseContext.getConf());
代码示例来源:origin: apache/hive
BasicStatsWork basicStatsWork = new BasicStatsWork(table.getTableSpec());
basicStatsWork.setIsExplicitAnalyze(true);
basicStatsWork.setNoScanAnalyzeCommand(parseContext.getQueryProperties().isNoScanAnalyzeCommand());
代码示例来源:origin: apache/drill
.getTableSpec());
snjWork.setStatsReliable(parseContext.getConf().getBoolVar(
HiveConf.ConfVars.HIVE_STATS_RELIABLE));
} else {
StatsWork statsWork = new StatsWork(tableScan.getConf().getTableMetadata().getTableSpec());
statsWork.setAggKey(tableScan.getConf().getStatsAggPrefix());
statsWork.setStatsTmpDir(tableScan.getConf().getTmpStatsDir());
代码示例来源:origin: apache/hive
BasicStatsWork basicStatsWork = new BasicStatsWork(table.getTableSpec());
basicStatsWork.setIsExplicitAnalyze(true);
basicStatsWork.setNoScanAnalyzeCommand(parseContext.getQueryProperties().isNoScanAnalyzeCommand());
代码示例来源:origin: apache/drill
StatsNoJobWork snjWork = new StatsNoJobWork(tableScan.getConf().getTableMetadata().getTableSpec());
snjWork.setStatsReliable(parseContext.getConf().getBoolVar(
HiveConf.ConfVars.HIVE_STATS_RELIABLE));
StatsWork statsWork = new StatsWork(tableScan.getConf().getTableMetadata().getTableSpec());
statsWork.setAggKey(tableScan.getConf().getStatsAggPrefix());
statsWork.setStatsTmpDir(tableScan.getConf().getTmpStatsDir());
代码示例来源:origin: apache/hive
BasicStatsWork statsWork = new BasicStatsWork(table.getTableSpec());
statsWork.setIsExplicitAnalyze(true);
代码示例来源:origin: apache/drill
.getTableSpec());
snjWork.setStatsReliable(parseContext.getConf().getBoolVar(
HiveConf.ConfVars.HIVE_STATS_RELIABLE));
StatsWork statsWork = new StatsWork(tableScan.getConf().getTableMetadata().getTableSpec());
statsWork.setAggKey(tableScan.getConf().getStatsAggPrefix());
statsWork.setStatsTmpDir(tableScan.getConf().getTmpStatsDir());
代码示例来源:origin: apache/drill
StatsNoJobWork snjWork = new StatsNoJobWork(op.getConf().getTableMetadata().getTableSpec());
snjWork.setStatsReliable(parseCtx.getConf().getBoolVar(
HiveConf.ConfVars.HIVE_STATS_RELIABLE));
StatsWork statsWork = new StatsWork(op.getConf().getTableMetadata().getTableSpec());
statsWork.setAggKey(op.getConf().getStatsAggPrefix());
statsWork.setStatsTmpDir(op.getConf().getTmpStatsDir());
代码示例来源:origin: com.facebook.presto.hive/hive-apache
public static Set<Partition> getConfirmedPartitionsForScan(TableScanOperator tableScanOp) {
Set<Partition> confirmedPartns = new HashSet<Partition>();
TableSpec tblSpec = tableScanOp.getConf().getTableMetadata().getTableSpec();
if (tblSpec.specType == TableSpec.SpecType.STATIC_PARTITION) {
// static partition
if (tblSpec.partHandle != null) {
confirmedPartns.add(tblSpec.partHandle);
} else {
// partial partition spec has null partHandle
confirmedPartns.addAll(tblSpec.partitions);
}
} else if (tblSpec.specType == TableSpec.SpecType.DYNAMIC_PARTITION) {
// dynamic partition
confirmedPartns.addAll(tblSpec.partitions);
}
return confirmedPartns;
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
public static List<String> getPartitionColumns(TableScanOperator tableScanOp) {
TableSpec tblSpec = tableScanOp.getConf().getTableMetadata().getTableSpec();
if (tblSpec.tableHandle.isPartitioned()) {
return new ArrayList<String>(tblSpec.getPartSpec().keySet());
}
return Collections.emptyList();
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
public static List<Path> getInputPathsForPartialScan(TableScanOperator tableScanOp,
StringBuffer aggregationKey) throws SemanticException {
List<Path> inputPaths = new ArrayList<Path>();
switch (tableScanOp.getConf().getTableMetadata().getTableSpec().specType) {
case TABLE_ONLY:
inputPaths.add(tableScanOp.getConf().getTableMetadata()
.getTableSpec().tableHandle.getPath());
break;
case STATIC_PARTITION:
Partition part = tableScanOp.getConf().getTableMetadata()
.getTableSpec().partHandle;
try {
aggregationKey.append(Warehouse.makePartPath(part.getSpec()));
} catch (MetaException e) {
throw new SemanticException(ErrorMsg.ANALYZE_TABLE_PARTIALSCAN_AGGKEY.getMsg(
part.getDataLocation().toString() + e.getMessage()));
}
inputPaths.add(part.getDataLocation());
break;
default:
assert false;
}
return inputPaths;
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
StatsNoJobWork snjWork = new StatsNoJobWork(tableScan.getConf().getTableMetadata().getTableSpec());
snjWork.setStatsReliable(parseContext.getConf().getBoolVar(
HiveConf.ConfVars.HIVE_STATS_RELIABLE));
StatsWork statsWork = new StatsWork(tableScan.getConf().getTableMetadata().getTableSpec());
statsWork.setAggKey(tableScan.getConf().getStatsAggPrefix());
statsWork.setSourceTask(context.currentTask);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
StatsNoJobWork snjWork = new StatsNoJobWork(tableScan.getConf().getTableMetadata().getTableSpec());
snjWork.setStatsReliable(parseContext.getConf().getBoolVar(
HiveConf.ConfVars.HIVE_STATS_RELIABLE));
StatsWork statsWork = new StatsWork(tableScan.getConf().getTableMetadata().getTableSpec());
statsWork.setAggKey(tableScan.getConf().getStatsAggPrefix());
statsWork.setSourceTask(context.currentTask);
代码示例来源:origin: com.facebook.presto.hive/hive-apache
StatsNoJobWork snjWork = new StatsNoJobWork(op.getConf().getTableMetadata().getTableSpec());
snjWork.setStatsReliable(parseCtx.getConf().getBoolVar(
HiveConf.ConfVars.HIVE_STATS_RELIABLE));
StatsWork statsWork = new StatsWork(op.getConf().getTableMetadata().getTableSpec());
statsWork.setAggKey(op.getConf().getStatsAggPrefix());
statsWork.setSourceTask(currTask);
内容来源于网络,如有侵权,请联系作者删除!