本文整理了Java中org.apache.hadoop.hive.ql.metadata.Table.getPartCols()
方法的一些代码示例,展示了Table.getPartCols()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getPartCols()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Table
类名称:Table
方法名:getPartCols
暂无
代码示例来源:origin: apache/hive
public boolean isPartitioned() {
if (getPartCols() == null) {
return false;
}
return (getPartCols().size() != 0);
}
代码示例来源:origin: apache/hive
public List<String> getPartColNames() {
List<String> partColNames = new ArrayList<String>();
for (FieldSchema key : getPartCols()) {
partColNames.add(key.getName());
}
return partColNames;
}
代码示例来源:origin: apache/hive
public static boolean isFullSpec(Table table, Map<String, String> partSpec) {
for (FieldSchema partCol : table.getPartCols()) {
if (partSpec.get(partCol.getName()) == null) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/hive
/**
* Returns a list of all the columns of the table (data columns + partition
* columns in that order.
*
* @return List<FieldSchema>
*/
public List<FieldSchema> getAllCols() {
ArrayList<FieldSchema> f_list = new ArrayList<FieldSchema>();
f_list.addAll(getCols());
f_list.addAll(getPartCols());
return f_list;
}
代码示例来源:origin: apache/hive
public FieldSchema getPartColByName(String colName) {
for (FieldSchema key : getPartCols()) {
if (key.getName().toLowerCase().equals(colName)) {
return key;
}
}
return null;
}
代码示例来源:origin: apache/hive
private static List<String> extractPartColNames(Table tab) {
List<FieldSchema> pCols = tab.getPartCols();
List<String> partCols = new ArrayList<String>(pCols.size());
for (FieldSchema pCol : pCols) {
partCols.add(pCol.getName());
}
return partCols;
}
代码示例来源:origin: apache/drill
/**
* Returns a list of all the columns of the table (data columns + partition
* columns in that order.
*
* @return List<FieldSchema>
*/
public List<FieldSchema> getAllCols() {
ArrayList<FieldSchema> f_list = new ArrayList<FieldSchema>();
f_list.addAll(getCols());
f_list.addAll(getPartCols());
return f_list;
}
代码示例来源:origin: apache/drill
public FieldSchema getPartColByName(String colName) {
for (FieldSchema key : getPartCols()) {
if (key.getName().toLowerCase().equals(colName)) {
return key;
}
}
return null;
}
代码示例来源:origin: apache/drill
public static boolean isFullSpec(Table table, Map<String, String> partSpec) {
for (FieldSchema partCol : table.getPartCols()) {
if (partSpec.get(partCol.getName()) == null) {
return false;
}
}
return true;
}
代码示例来源:origin: apache/hive
public ColumnStatsAutoGatherContext(SemanticAnalyzer sa, HiveConf conf,
Operator<? extends OperatorDesc> op, Table tbl, Map<String, String> partSpec,
boolean isInsertInto, Context ctx) throws SemanticException {
super();
this.sa = sa;
this.conf = conf;
this.op = op;
this.tbl = tbl;
this.partSpec = partSpec;
this.isInsertInto = isInsertInto;
this.origCtx = ctx;
columns = tbl.getCols();
partitionColumns = tbl.getPartCols();
}
代码示例来源:origin: apache/drill
private static List<String> extractPartColNames(Table tab) {
List<FieldSchema> pCols = tab.getPartCols();
List<String> partCols = new ArrayList<String>(pCols.size());
for (FieldSchema pCol : pCols) {
partCols.add(pCol.getName());
}
return partCols;
}
代码示例来源:origin: apache/hive
private static List<PrimitiveTypeInfo> extractPartColTypes(Table tab) {
List<FieldSchema> pCols = tab.getPartCols();
List<PrimitiveTypeInfo> partColTypeInfos = new ArrayList<PrimitiveTypeInfo>(pCols.size());
for (FieldSchema pCol : pCols) {
partColTypeInfos.add(TypeInfoFactory.getPrimitiveTypeInfo(pCol.getType()));
}
return partColTypeInfos;
}
代码示例来源:origin: apache/hive
@Override
public List<String> getValues() {
List<String> values = new ArrayList<String>();
for (FieldSchema fs : this.getTable().getPartCols()) {
values.add(partSpec.get(fs.getName()));
}
return values;
}
代码示例来源:origin: apache/hive
/**
* @param targetTableNameInSourceQuery alias or simple name
*/
OnClauseAnalyzer(ASTNode onClause, Table targetTable, String targetTableNameInSourceQuery,
HiveConf conf, String onClauseAsString) {
this.onClause = onClause;
allTargetTableColumns.addAll(targetTable.getCols());
allTargetTableColumns.addAll(targetTable.getPartCols());
this.targetTableNameInSourceQuery = unescapeIdentifier(targetTableNameInSourceQuery);
this.conf = conf;
this.onClauseAsString = onClauseAsString;
}
代码示例来源:origin: apache/drill
@Override
public List<String> getValues() {
List<String> values = new ArrayList<String>();
for (FieldSchema fs : this.getTable().getPartCols()) {
values.add(partSpec.get(fs.getName()));
}
return values;
}
代码示例来源:origin: apache/hive
public String getName() {
try {
return Warehouse.makePartName(table.getPartCols(), tPartition.getValues());
} catch (MetaException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: apache/drill
private static List<PrimitiveTypeInfo> extractPartColTypes(Table tab) {
List<FieldSchema> pCols = tab.getPartCols();
List<PrimitiveTypeInfo> partColTypeInfos = new ArrayList<PrimitiveTypeInfo>(pCols.size());
for (FieldSchema pCol : pCols) {
partColTypeInfos.add(TypeInfoFactory.getPrimitiveTypeInfo(pCol.getType()));
}
return partColTypeInfos;
}
代码示例来源:origin: apache/drill
public String getName() {
try {
return Warehouse.makePartName(table.getPartCols(), tPartition.getValues());
} catch (MetaException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: apache/hive
public ExtractPartPruningPredicate(RelOptCluster cluster,
RelOptHiveTable hiveTable) {
super(true);
this.hiveTable = hiveTable;
rType = hiveTable.getRowType();
List<FieldSchema> pfs = hiveTable.getHiveTableMD().getPartCols();
partCols = new HashSet<String>();
for (FieldSchema pf : pfs) {
partCols.add(pf.getName());
}
this.cluster = cluster;
}
代码示例来源:origin: apache/hive
public void checkValidity() throws HiveException {
if (!tPartition.getSd().equals(table.getSd())) {
Table.validateColumns(getCols(), table.getPartCols());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!