org.apache.hadoop.hive.ql.metadata.Hive.getUserName()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.apache.hadoop.hive.ql.metadata.Hive.getUserName()方法的一些代码示例,展示了Hive.getUserName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hive.getUserName()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Hive
类名称:Hive
方法名:getUserName

Hive.getUserName介绍

暂无

代码示例

代码示例来源:origin: apache/hive

/**
 * get all the partitions that the table has
 *
 * @param tbl
 *          object for which partition is needed
 * @return list of partition objects
 */
public List<Partition> getPartitions(Table tbl) throws HiveException {
 if (tbl.isPartitioned()) {
  List<org.apache.hadoop.hive.metastore.api.Partition> tParts;
  try {
   tParts = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
     (short) -1, getUserName(), getGroupNames());
  } catch (Exception e) {
   LOG.error(StringUtils.stringifyException(e));
   throw new HiveException(e);
  }
  List<Partition> parts = new ArrayList<Partition>(tParts.size());
  for (org.apache.hadoop.hive.metastore.api.Partition tpart : tParts) {
   parts.add(new Partition(tbl, tpart));
  }
  return parts;
 } else {
  Partition part = new Partition(tbl);
  ArrayList<Partition> parts = new ArrayList<Partition>(1);
  parts.add(part);
  return parts;
 }
}

代码示例来源:origin: apache/drill

/**
 * get all the partitions that the table has
 *
 * @param tbl
 *          object for which partition is needed
 * @return list of partition objects
 * @throws HiveException
 */
public List<Partition> getPartitions(Table tbl) throws HiveException {
 if (tbl.isPartitioned()) {
  List<org.apache.hadoop.hive.metastore.api.Partition> tParts;
  try {
   tParts = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
     (short) -1, getUserName(), getGroupNames());
  } catch (Exception e) {
   LOG.error(StringUtils.stringifyException(e));
   throw new HiveException(e);
  }
  List<Partition> parts = new ArrayList<Partition>(tParts.size());
  for (org.apache.hadoop.hive.metastore.api.Partition tpart : tParts) {
   parts.add(new Partition(tbl, tpart));
  }
  return parts;
 } else {
  Partition part = new Partition(tbl);
  ArrayList<Partition> parts = new ArrayList<Partition>(1);
  parts.add(part);
  return parts;
 }
}

代码示例来源:origin: apache/hive

try {
 partitions = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
   partialPvals, limit, getUserName(), getGroupNames());
} catch (Exception e) {
 throw new HiveException(e);

代码示例来源:origin: apache/drill

try {
 partitions = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
   partialPvals, limit, getUserName(), getGroupNames());
} catch (Exception e) {
 throw new HiveException(e);

代码示例来源:origin: apache/hive

try {
 tpart = getSynchronizedMSC().getPartitionWithAuthInfo(tbl.getDbName(),
   tbl.getTableName(), pvals, getUserName(), getGroupNames());
} catch (NoSuchObjectException nsoe) {
    LOG.debug("Caught already exists exception, trying to alter partition instead");
    tpart = getSynchronizedMSC().getPartitionWithAuthInfo(tbl.getDbName(),
     tbl.getTableName(), pvals, getUserName(), getGroupNames());
    alterPartitionSpec(tbl, partSpec, tpart, inheritTableSpecs, partPath);
   } catch (Exception e) {
      tbl.getTableName(), pvals, getUserName(), getGroupNames());
     if (tpart == null) {

代码示例来源:origin: apache/drill

try {
 tpart = getMSC().getPartitionWithAuthInfo(tbl.getDbName(),
   tbl.getTableName(), pvals, getUserName(), getGroupNames());
} catch (NoSuchObjectException nsoe) {
    LOG.debug("Caught already exists exception, trying to alter partition instead");
    tpart = getMSC().getPartitionWithAuthInfo(tbl.getDbName(),
     tbl.getTableName(), pvals, getUserName(), getGroupNames());
    alterPartitionSpec(tbl, partSpec, tpart, inheritTableSpecs, partPath);
   } catch (Exception e) {
      tbl.getTableName(), pvals, getUserName(), getGroupNames());
     if (tpart == null) {

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

/**
 * get all the partitions that the table has
 *
 * @param tbl
 *          object for which partition is needed
 * @return list of partition objects
 * @throws HiveException
 */
public List<Partition> getPartitions(Table tbl) throws HiveException {
 if (tbl.isPartitioned()) {
  List<org.apache.hadoop.hive.metastore.api.Partition> tParts;
  try {
   tParts = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
     (short) -1, getUserName(), getGroupNames());
  } catch (Exception e) {
   LOG.error(StringUtils.stringifyException(e));
   throw new HiveException(e);
  }
  List<Partition> parts = new ArrayList<Partition>(tParts.size());
  for (org.apache.hadoop.hive.metastore.api.Partition tpart : tParts) {
   parts.add(new Partition(tbl, tpart));
  }
  return parts;
 } else {
  Partition part = new Partition(tbl);
  ArrayList<Partition> parts = new ArrayList<Partition>(1);
  parts.add(part);
  return parts;
 }
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/**
 * get all the partitions that the table has
 *
 * @param tbl
 *          object for which partition is needed
 * @return list of partition objects
 * @throws HiveException
 */
public List<Partition> getPartitions(Table tbl) throws HiveException {
 if (tbl.isPartitioned()) {
  List<org.apache.hadoop.hive.metastore.api.Partition> tParts;
  try {
   tParts = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
     (short) -1, getUserName(), getGroupNames());
  } catch (Exception e) {
   LOG.error(StringUtils.stringifyException(e));
   throw new HiveException(e);
  }
  List<Partition> parts = new ArrayList<Partition>(tParts.size());
  for (org.apache.hadoop.hive.metastore.api.Partition tpart : tParts) {
   parts.add(new Partition(tbl, tpart));
  }
  return parts;
 } else {
  Partition part = new Partition(tbl);
  ArrayList<Partition> parts = new ArrayList<Partition>(1);
  parts.add(part);
  return parts;
 }
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

/**
 * get all the partitions of the table that matches the given partial
 * specification. partition columns whose value is can be anything should be
 * an empty string.
 *
 * @param tbl
 *          object for which partition is needed. Must be partitioned.
 * @return list of partition objects
 * @throws HiveException
 */
public List<Partition> getPartitions(Table tbl, Map<String, String> partialPartSpec)
throws HiveException {
 if (!tbl.isPartitioned()) {
  throw new HiveException("Partition spec should only be supplied for a " +
      "partitioned table");
 }
 List<String> partialPvals = getPvals(tbl.getPartCols(), partialPartSpec);
 List<org.apache.hadoop.hive.metastore.api.Partition> partitions = null;
 try {
  partitions = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
    partialPvals, (short) -1, getUserName(), getGroupNames());
 } catch (Exception e) {
  throw new HiveException(e);
 }
 List<Partition> qlPartitions = new ArrayList<Partition>();
 for (org.apache.hadoop.hive.metastore.api.Partition p : partitions) {
  qlPartitions.add( new Partition(tbl, p));
 }
 return qlPartitions;
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

try {
 partitions = getMSC().listPartitionsWithAuthInfo(tbl.getDbName(), tbl.getTableName(),
   partialPvals, limit, getUserName(), getGroupNames());
} catch (Exception e) {
 throw new HiveException(e);

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

try {
 tpart = getMSC().getPartitionWithAuthInfo(tbl.getDbName(),
   tbl.getTableName(), pvals, getUserName(), getGroupNames());
} catch (NoSuchObjectException nsoe) {

代码示例来源:origin: com.facebook.presto.hive/hive-apache

try {
 tpart = getMSC().getPartitionWithAuthInfo(tbl.getDbName(),
   tbl.getTableName(), pvals, getUserName(), getGroupNames());
} catch (NoSuchObjectException nsoe) {
    LOG.debug("Caught already exists exception, trying to alter partition instead");
    tpart = getMSC().getPartitionWithAuthInfo(tbl.getDbName(),
     tbl.getTableName(), pvals, getUserName(), getGroupNames());
    alterPartitionSpec(tbl, partSpec, tpart, inheritTableSpecs, partPath);
   } catch (Exception e) {
      tbl.getTableName(), pvals, getUserName(), getGroupNames());
     if (tpart == null) {

相关文章

微信公众号

最新文章

更多

Hive类方法