本文整理汇总了Java中org.apache.hadoop.hive.metastore.api.Table.getParameters方法的典型用法代码示例。如果您正苦于以下问题:Java Table.getParameters方法的具体用法?Java Table.getParameters怎么用?Java Table.getParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hive.metastore.api.Table
的用法示例。
在下文中一共展示了Table.getParameters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HiveTable
import org.apache.hadoop.hive.metastore.api.Table; //导入方法依赖的package包/类
public HiveTable(Table table) {
if (table == null) {
return;
}
this.table = table;
this.tableName = table.getTableName();
this.dbName = table.getDbName();
this.owner = table.getOwner();
this.createTime = table.getCreateTime();
this.lastAccessTime = table.getLastAccessTime();
this.retention = table.getRetention();
this.sd = new StorageDescriptorWrapper(table.getSd());
this.partitionKeys = Lists.newArrayList();
for (FieldSchema f : table.getPartitionKeys()) {
this.partitionKeys.add(new FieldSchemaWrapper(f));
partitionNameTypeMap.put(f.getName(), f.getType());
}
this.parameters = table.getParameters();
this.viewOriginalText = table.getViewOriginalText();
this.viewExpandedText = table.getViewExpandedText();
this.tableType = table.getTableType();
}
示例2: commitDropTable
import org.apache.hadoop.hive.metastore.api.Table; //导入方法依赖的package包/类
public void commitDropTable(Table table, boolean deleteData) throws MetaException {
boolean isExternal = isExternalTable(table);
String tableName = getMonarchTableName(table);
try {
Map<String, String> parameters = table.getParameters();
String tableType = parameters.getOrDefault(MonarchUtils.MONARCH_TABLE_TYPE, MonarchUtils.DEFAULT_TABLE_TYPE);
if (tableType.equalsIgnoreCase(MonarchUtils.DEFAULT_TABLE_TYPE)) {
MonarchUtils.destroyFTable(tableName, table.getParameters(), isExternal, deleteData);
} else {
MonarchUtils.destroyTable(tableName, table.getParameters(), isExternal, deleteData);
}
} catch (Exception se) {
throw new MetaException(se.getMessage());
}
}
示例3: preCreateTable
import org.apache.hadoop.hive.metastore.api.Table; //导入方法依赖的package包/类
public void preCreateTable(Table table) throws MetaException {
// We want data to be stored in monarch, nowwhere else.
if (table.getSd().getLocation() != null) {
throw new MetaException("Location can't be specified for Monarch");
}
boolean isExternal = isExternalTable(table);
String tableName = getMonarchTableName(table);
String hiveTableName = table.getDbName() + "_" + table.getTableName();
Map<String, String> columnInfo = new LinkedHashMap<>();
Iterator<FieldSchema> columnIterator = table.getSd().getColsIterator();
if (columnIterator != null) {
while (columnIterator.hasNext()) {
FieldSchema e = columnIterator.next();
columnInfo.put(e.getName(), e.getType());
}
}
try {
Map<String, String> parameters = table.getParameters();
String tableType = parameters.getOrDefault(MonarchUtils.MONARCH_TABLE_TYPE, MonarchUtils.DEFAULT_TABLE_TYPE);
if (tableType.equalsIgnoreCase(MonarchUtils.DEFAULT_TABLE_TYPE)) {
MonarchUtils.createConnectionAndFTable(tableName, parameters, isExternal, hiveTableName, columnInfo);
} else {
MonarchUtils.createConnectionAndTable(tableName, parameters, isExternal, hiveTableName, columnInfo);
}
} catch (Exception se) {
LOG.error("Failed to create table: {}", tableName, se);
throw new MetaException(se.getMessage());
}
}