本文整理了Java中org.apache.hadoop.hive.ql.exec.Utilities.getQualifiedPath()
方法的一些代码示例,展示了Utilities.getQualifiedPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.getQualifiedPath()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.exec.Utilities
类名称:Utilities
方法名:getQualifiedPath
[英]Convert path to qualified path.
[中]将路径转换为限定路径。
代码示例来源:origin: apache/hive
private void makeLocationQualified(Database database) throws HiveException {
if (database.isSetLocationUri()) {
database.setLocationUri(Utilities.getQualifiedPath(conf, new Path(database.getLocationUri())));
}
else {
// Location is not set we utilize METASTOREWAREHOUSE together with database name
database.setLocationUri(
Utilities.getQualifiedPath(conf, new Path(HiveConf.getVar(conf, HiveConf.ConfVars.METASTOREWAREHOUSE),
database.getName().toLowerCase() + DATABASE_PATH_SUFFIX)));
}
}
代码示例来源:origin: apache/drill
private void makeLocationQualified(Database database) throws HiveException {
if (database.isSetLocationUri()) {
database.setLocationUri(Utilities.getQualifiedPath(conf, new Path(database.getLocationUri())));
}
else {
// Location is not set we utilize METASTOREWAREHOUSE together with database name
database.setLocationUri(
Utilities.getQualifiedPath(conf, new Path(HiveConf.getVar(conf, HiveConf.ConfVars.METASTOREWAREHOUSE),
database.getName().toLowerCase() + DATABASE_PATH_SUFFIX)));
}
}
代码示例来源:origin: apache/drill
sd.setLocation(Utilities.getQualifiedPath(conf, path));
代码示例来源:origin: apache/drill
/**
* Make qualified location for an index .
*
* @param crtIndex
* Create index descriptor.
* @param name
* Object name.
*/
private void makeLocationQualified(CreateIndexDesc crtIndex, String name) throws HiveException
{
Path path = null;
if (crtIndex.getLocation() == null) {
// Location is not set, leave it as-is if index doesn't belong to default DB
// Currently all indexes are created in current DB only
if (Utilities.getDatabaseName(name).equalsIgnoreCase(MetaStoreUtils.DEFAULT_DATABASE_NAME)) {
// Default database name path is always ignored, use METASTOREWAREHOUSE and object name
// instead
String warehouse = HiveConf.getVar(conf, ConfVars.METASTOREWAREHOUSE);
String tableName = Utilities.getTableName(name);
path = new Path(warehouse, tableName.toLowerCase());
}
}
else {
path = new Path(crtIndex.getLocation());
}
if (path != null) {
crtIndex.setLocation(Utilities.getQualifiedPath(conf, path));
}
}
代码示例来源:origin: apache/hive
/**
* Make location in specified sd qualified.
*
* @param databaseName
* Database name.
* @param sd
* Storage descriptor.
* @param name
* Object name.
*/
public static void makeLocationQualified(String databaseName, Table table, HiveConf conf) throws HiveException {
Path path = null;
StorageDescriptor sd = table.getTTable().getSd();
// If the table's location is currently unset, it is left unset, allowing the metastore to
// fill in the table's location.
// Note that the previous logic for some reason would make a special case if the DB was the
// default database, and actually attempt to generate a location.
// This seems incorrect and uncessary, since the metastore is just as able to fill in the
// default table location in the case of the default DB, as it is for non-default DBs.
if (sd.isSetLocation())
{
path = new Path(sd.getLocation());
}
if (path != null)
{
sd.setLocation(Utilities.getQualifiedPath(conf, path));
}
}
代码示例来源:origin: apache/hive
location = Utilities.getQualifiedPath(conf, new Path(location));
tmpPart.setLocation(location);
代码示例来源:origin: apache/hive
String location = newPart.getLocation();
if (location != null) {
location = Utilities.getQualifiedPath(conf, new Path(location));
newPart.setLocation(location);
代码示例来源:origin: apache/hive
if (location != null) {
location = new Path(Utilities.getQualifiedPath(conf, location));
代码示例来源:origin: apache/drill
if (location !=null && !Utilities.isDefaultNameNode(conf)) {
location = new Path(Utilities.getQualifiedPath(conf, location));
代码示例来源:origin: com.facebook.presto.hive/hive-apache
/**
* Make qualified location for a database .
*
* @param database
* Database.
*/
private void makeLocationQualified(Database database) throws HiveException {
if (database.isSetLocationUri()) {
database.setLocationUri(Utilities.getQualifiedPath(conf, new Path(database.getLocationUri())));
}
else {
// Location is not set we utilize METASTOREWAREHOUSE together with database name
database.setLocationUri(
Utilities.getQualifiedPath(conf, new Path(HiveConf.getVar(conf, HiveConf.ConfVars.METASTOREWAREHOUSE),
database.getName().toLowerCase() + ".db")));
}
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
sd.setLocation(Utilities.getQualifiedPath(conf, path));
代码示例来源:origin: com.facebook.presto.hive/hive-apache
/**
* Make qualified location for an index .
*
* @param crtIndex
* Create index descriptor.
* @param name
* Object name.
*/
private void makeLocationQualified(CreateIndexDesc crtIndex, String name) throws HiveException
{
Path path = null;
if (crtIndex.getLocation() == null) {
// Location is not set, leave it as-is if index doesn't belong to default DB
// Currently all indexes are created in current DB only
if (Utilities.getDatabaseName(name).equalsIgnoreCase(MetaStoreUtils.DEFAULT_DATABASE_NAME)) {
// Default database name path is always ignored, use METASTOREWAREHOUSE and object name
// instead
String warehouse = HiveConf.getVar(conf, ConfVars.METASTOREWAREHOUSE);
String tableName = Utilities.getTableName(name);
path = new Path(warehouse, tableName.toLowerCase());
}
}
else {
path = new Path(crtIndex.getLocation());
}
if (path != null) {
crtIndex.setLocation(Utilities.getQualifiedPath(conf, path));
}
}
代码示例来源:origin: com.facebook.presto.hive/hive-apache
if (location !=null && !Utilities.isDefaultNameNode(conf)) {
location = new Path(Utilities.getQualifiedPath(conf, location));
内容来源于网络,如有侵权,请联系作者删除!