本文整理汇总了Java中org.apache.hadoop.hive.metastore.api.StorageDescriptor.setSortCols方法的典型用法代码示例。如果您正苦于以下问题:Java StorageDescriptor.setSortCols方法的具体用法?Java StorageDescriptor.setSortCols怎么用?Java StorageDescriptor.setSortCols使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hive.metastore.api.StorageDescriptor
的用法示例。
在下文中一共展示了StorageDescriptor.setSortCols方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeMetastoreTableObject
import org.apache.hadoop.hive.metastore.api.StorageDescriptor; //导入方法依赖的package包/类
public Table makeMetastoreTableObject(HiveMetaStoreClient client,
String dbName, String tabName, List<FieldSchema> cols) throws Exception {
Table tbl = new Table();
tbl.setDbName(dbName);
tbl.setTableName(tabName);
StorageDescriptor sd = new StorageDescriptor();
tbl.setSd(sd);
tbl.setParameters(new HashMap<String, String>());
sd.setCols(cols);
sd.setCompressed(false);
sd.setParameters(new HashMap<String, String>());
sd.setSerdeInfo(new SerDeInfo());
sd.getSerdeInfo().setName(tbl.getTableName());
sd.getSerdeInfo().setParameters(new HashMap<String, String>());
sd.getSerdeInfo().getParameters()
.put(serdeConstants.SERIALIZATION_FORMAT, "1");
sd.setSortCols(new ArrayList<Order>());
return tbl;
}
示例2: fromStorageDto
import org.apache.hadoop.hive.metastore.api.StorageDescriptor; //导入方法依赖的package包/类
private StorageDescriptor fromStorageDto(@Nullable final StorageDto storageDto) {
// Set all required fields to a non-null value
final StorageDescriptor result = new StorageDescriptor();
String inputFormat = "";
String location = "";
String outputFormat = "";
final String serdeName = "";
String serializationLib = "";
Map<String, String> sdParams = Maps.newHashMap();
Map<String, String> serdeParams = Maps.newHashMap();
if (storageDto != null) {
if (storageDto.getInputFormat() != null) {
inputFormat = storageDto.getInputFormat();
}
if (storageDto.getUri() != null) {
location = storageDto.getUri();
}
if (storageDto.getOutputFormat() != null) {
outputFormat = storageDto.getOutputFormat();
}
if (storageDto.getSerializationLib() != null) {
serializationLib = storageDto.getSerializationLib();
}
if (storageDto.getParameters() != null) {
sdParams = storageDto.getParameters();
}
if (storageDto.getSerdeInfoParameters() != null) {
serdeParams = storageDto.getSerdeInfoParameters();
}
}
result.setInputFormat(inputFormat);
result.setLocation(location);
result.setOutputFormat(outputFormat);
result.setSerdeInfo(new SerDeInfo(serdeName, serializationLib, serdeParams));
result.setCols(Collections.emptyList());
result.setBucketCols(Collections.emptyList());
result.setSortCols(Collections.emptyList());
result.setParameters(sdParams);
return result;
}