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

x33g5p2x  于2022-01-29 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(189)

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

Table.getDbName介绍

暂无

代码示例

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

public TableSpec(Table table) {
 tableHandle = table;
 tableName = table.getDbName() + "." + table.getTableName();
 specType = SpecType.TABLE_ONLY;
}

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

public String getFullTableName() {
 return table.getDbName() + "." + table.getTableName();
}

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

@Override
public String getSimpleName() {
 return String.format("Table %s.%s", table.getDbName(), table.getTableName());
}

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

private static String getTmptTableNameForExport(Table exportTable) {
 String tmpTableDb = exportTable.getDbName();
 String tmpTableName = exportTable.getTableName() + "_" + UUID.randomUUID().toString().replace('-', '_');
 return Warehouse.getQualifiedName(tmpTableDb, tmpTableName);
}

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

/**
 * @return include the db name
 */
public String getCompleteName() {
 return getCompleteName(getDbName(), getTableName());
}

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

/** Note: this is generally called in Hive.java; so, the callers of Hive.java make sure
 *        to set up the acid state during compile, and Hive.java retrieves it if needed. */
public static TableSnapshot getTableSnapshot(
  Configuration conf, Table tbl, boolean isStatsUpdater) throws LockException {
 return getTableSnapshot(conf, tbl, tbl.getDbName(), tbl.getTableName(), isStatsUpdater);
}

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

/**
 * Removes the materialized view from the cache.
 *
 * @param materializedViewTable the materialized view to remove
 */
public void dropMaterializedView(Table materializedViewTable) {
 dropMaterializedView(materializedViewTable.getDbName(), materializedViewTable.getTableName());
}

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

@Override
public String getSimpleName() {
 return String.format("Partition %s.%s %s", table.getDbName(), table.getTableName(), partition.getSpec());
}

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

/**
 * Generate the statement of analyze table [tablename] compute statistics for columns
 * In non-partitioned table case, it will generate TS-SEL-GBY-RS-GBY-SEL-FS operator
 * In static-partitioned table case, it will generate TS-FIL(partitionKey)-SEL-GBY(partitionKey)-RS-GBY-SEL-FS operator
 * In dynamic-partitioned table case, it will generate TS-SEL-GBY(partitionKey)-RS-GBY-SEL-FS operator
 * However, we do not need to specify the partition-spec because (1) the data is going to be inserted to that specific partition
 * (2) we can compose the static/dynamic partition using a select operator in replaceSelectOperatorProcess.
 */
public void insertAnalyzePipeline() throws SemanticException{
 String analyzeCommand = "analyze table `" + tbl.getDbName() + "`.`" + tbl.getTableName() + "`"
   + " compute statistics for columns ";
 insertAnalyzePipeline(analyzeCommand, false);
}

代码示例来源:origin: apache/incubator-gobblin

/**
 * Resolve {@value #DATABASE_TOKEN} and {@value #TABLE_TOKEN} in <code>rawString</code> to {@link Table#getDbName()}
 * and {@link Table#getTableName()}
 */
public static String resolveTemplate(String rawString, Table table) {
 if (StringUtils.isBlank(rawString)) {
  return rawString;
 }
 return StringUtils.replaceEach(rawString, new String[] { DATABASE_TOKEN, TABLE_TOKEN }, new String[] { table.getDbName(), table.getTableName() });
}

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

public HiveLockObject(Table tbl, HiveLockObjectData lockData) {
 this(new String[] {tbl.getDbName(), org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.encodeTableName(tbl.getTableName())}, lockData);
}

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

/**
 * @return include the db name
 */
public String getCompleteName() {
 return getCompleteName(getDbName(), getTableName());
}

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

private void alterPartitionSpec(Table tbl,
                Map<String, String> partSpec,
                org.apache.hadoop.hive.metastore.api.Partition tpart,
                boolean inheritTableSpecs,
                String partPath) throws HiveException, InvalidOperationException {
 alterPartitionSpecInMemory(tbl, partSpec, tpart, inheritTableSpecs, partPath);
 String fullName = tbl.getTableName();
 if (!org.apache.commons.lang.StringUtils.isEmpty(tbl.getDbName())) {
  fullName = tbl.getDbName() + "." + tbl.getTableName();
 }
 alterPartition(fullName, new Partition(tbl, tpart), null);
}

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

public void alterTable(Table newTbl, boolean cascade, EnvironmentContext environmentContext,
  boolean transactional) throws HiveException {
 alterTable(newTbl.getCatName(), newTbl.getDbName(),
   newTbl.getTableName(), newTbl, cascade, environmentContext, transactional);
}

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

public TableScanDesc(final String alias, List<VirtualColumn> vcs, Table tblMetadata) {
 this.alias = alias;
 this.virtualCols = vcs;
 this.tableMetadata = tblMetadata;
 if (tblMetadata != null) {
  dbName = tblMetadata.getDbName();
  tableName = tblMetadata.getTableName();
 }
 isTranscationalTable = AcidUtils.isTransactionalTable(this.tableMetadata);
 if (isTranscationalTable) {
  acidOperationalProperties = AcidUtils.getAcidOperationalProperties(this.tableMetadata);
 }
}

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

private List<String> getTablesFromEntitySet(Set<? extends Entity> entities) {
 List<String> tableNames = new ArrayList<>();
 for (Entity entity : entities) {
  if (entity.getType() == Entity.Type.TABLE) {
   tableNames.add(entity.getTable().getDbName() + "." + entity.getTable().getTableName());
  }
 }
 return tableNames;
}

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

private void alterPartitionSpec(Table tbl,
                Map<String, String> partSpec,
                org.apache.hadoop.hive.metastore.api.Partition tpart,
                boolean inheritTableSpecs,
                String partPath) throws HiveException, InvalidOperationException {
 alterPartitionSpecInMemory(tbl, partSpec, tpart, inheritTableSpecs, partPath);
 String fullName = tbl.getTableName();
 if (!org.apache.commons.lang.StringUtils.isEmpty(tbl.getDbName())) {
  fullName = tbl.getFullyQualifiedName();
 }
 alterPartition(tbl.getCatalogName(), tbl.getDbName(), tbl.getTableName(),
   new Partition(tbl, tpart), null, true);
}

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

protected List<String> getTablesFromEntitySet(Set<? extends Entity> entities) {
 List<String> tableNames = new ArrayList<String>();
 for (Entity entity : entities) {
  if (entity.getType() == Entity.Type.TABLE) {
   tableNames.add(entity.getTable().getDbName() + "." + entity.getTable().getTableName());
  }
 }
 return tableNames;
}

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

protected static Map<String, String> getColNameToDefaultValueMap(Table tbl) throws SemanticException {
 Map<String, String> colNameToDefaultVal = null;
 try {
  DefaultConstraint dc = Hive.get().getEnabledDefaultConstraints(tbl.getDbName(), tbl.getTableName());
  colNameToDefaultVal = dc.getColNameToDefaultValueMap();
 } catch (Exception e) {
  if (e instanceof SemanticException) {
   throw (SemanticException) e;
  } else {
   throw (new RuntimeException(e));
  }
 }
 return colNameToDefaultVal;
}

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

@Override
public void authorize(Table table, Privilege[] inputRequiredPriv,
  Privilege[] outputRequiredPriv) throws HiveException {
 BitSetChecker checker = BitSetChecker.getBitSetChecker(inputRequiredPriv,
   outputRequiredPriv);
 boolean[] inputCheck = checker.inputCheck;
 boolean[] outputCheck = checker.outputCheck;
 authorizeUserDBAndTable(table, inputRequiredPriv,
   outputRequiredPriv, inputCheck, outputCheck);
 checkAndThrowAuthorizationException(inputRequiredPriv, outputRequiredPriv,
   inputCheck, outputCheck, table.getDbName(), table.getTableName(),
   null, null);
}

相关文章

Table类方法