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

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

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

Hive.getFunctions介绍

暂无

代码示例

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

private boolean isDbEmpty(String dbName) throws HiveException {
 List<String> allTables = context.hiveDb.getAllTables(dbName);
 List<String> allFunctions = context.hiveDb.getFunctions(dbName, "*");
 return allTables.isEmpty() && allFunctions.isEmpty();
}

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

void dumpFunctionMetadata(String dbName, Path dumpRoot, Hive hiveDb) throws Exception {
 Path functionsRoot = new Path(new Path(dumpRoot, dbName), FUNCTIONS_ROOT_DIR_NAME);
 List<String> functionNames = hiveDb.getFunctions(dbName, "*");
 for (String functionName : functionNames) {
  HiveWrapper.Tuple<Function> tuple = functionTuple(functionName, dbName, hiveDb);
  if (tuple == null) {
   continue;
  }
  Path functionRoot = new Path(functionsRoot, functionName);
  Path functionMetadataFile = new Path(functionRoot, FUNCTION_METADATA_FILE_NAME);
  try (JsonWriter jsonWriter =
    new JsonWriter(functionMetadataFile.getFileSystem(conf), functionMetadataFile)) {
   FunctionSerializer serializer = new FunctionSerializer(tuple.object, conf);
   serializer.writeTo(jsonWriter, tuple.replicationSpec);
  }
  replLogger.functionLog(functionName);
 }
}

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

public void clearUDFsCreatedDuringTests() throws Exception {
 if (System.getenv(QTEST_LEAVE_FILES) != null) {
  return;
 }
 // Delete functions created by the tests
 // It is enough to remove functions from the default database, other databases are dropped
 for (String udfName : db.getFunctions(DEFAULT_DATABASE_NAME, ".*")) {
  if (!srcUDFs.contains(udfName)) {
   db.dropFunction(DEFAULT_DATABASE_NAME, udfName);
  }
 }
}

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

public static void reloadFunctions() throws HiveException {
 Hive db = Hive.get();
 for (String dbName : db.getAllDatabases()) {
  for (String functionName : db.getFunctions(dbName, "*")) {
   Function function = db.getFunction(dbName, functionName);
   try {
  FunctionRegistry.registerPermanentFunction(
    FunctionUtils.qualifyFunctionName(functionName, dbName), function.getClassName(),
    false, FunctionTask.toFunctionResource(function.getResourceUris()));
   } catch (Exception e) {
    LOG.warn("Failed to register persistent function " +
      functionName + ":" + function.getClassName() + ". Ignore and continue.");
   }
  }
 }
}

相关文章

Hive类方法