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


Java Table.getParameters方法代码示例

本文整理汇总了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();
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:23,代码来源:HiveTable.java

示例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());
            }
        }
 
开发者ID:ampool,项目名称:monarch,代码行数:17,代码来源:MonarchStorageHandler.java

示例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());
    }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:34,代码来源:MonarchStorageHandler.java


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