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

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

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

Hive.alterIndex介绍

[英]Updates the existing index metadata with the new metadata.
[中]使用新元数据更新现有索引元数据。

代码示例

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

public void alterIndex(String baseTableName, String indexName, Index newIdx)
  throws InvalidOperationException, HiveException {
 String[] names = Utilities.getDbTableName(baseTableName);
 alterIndex(names[0], names[1], indexName, newIdx);
}

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

db.alterIndex(baseTableName, indexName, idx);
} catch (InvalidOperationException e) {
 console.printError("Invalid alter operation: " + e.getMessage());

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

public void alterIndex(String baseTableName, String indexName, Index newIdx)
  throws InvalidOperationException, HiveException {
 String[] names = Utilities.getDbTableName(baseTableName);
 alterIndex(names[0], names[1], indexName, newIdx);
}

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

db.alterIndex(baseTableName, indexName, idx);
} catch (InvalidOperationException e) {
 console.printError("Invalid alter operation: " + e.getMessage());

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

private int alterIndex(Hive db, AlterIndexDesc alterIndex) throws HiveException {
 String dbName = alterIndex.getDbName();
 String baseTableName = alterIndex.getBaseTableName();
 String indexName = alterIndex.getIndexName();
 Index idx = db.getIndex(dbName, baseTableName, indexName);
 if (alterIndex.getOp() == AlterIndexDesc.AlterIndexTypes.ADDPROPS) {
  idx.getParameters().putAll(alterIndex.getProps());
 } else {
  console.printError("Unsupported Alter commnad");
  return 1;
 }
 // set last modified by properties
 if (!updateModifiedParameters(idx.getParameters(), conf)) {
  return 1;
 }
 try {
  db.alterIndex(dbName, baseTableName, indexName, idx);
 } catch (InvalidOperationException e) {
  console.printError("Invalid alter operation: " + e.getMessage());
  LOG.info("alter index: " + stringifyException(e));
  return 1;
 } catch (HiveException e) {
  console.printError("Invalid alter operation: " + e.getMessage());
  return 1;
 }
 return 0;
}

相关文章

Hive类方法