当前位置: 首页>>代码示例>>Java>>正文


Java StorageDescriptor.setSortCols方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:20,代码来源:AbstractMetastoreTestWithStaticConfiguration.java

示例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;
}
 
开发者ID:Netflix,项目名称:metacat,代码行数:43,代码来源:HiveConvertersImpl.java


注:本文中的org.apache.hadoop.hive.metastore.api.StorageDescriptor.setSortCols方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。