org.apache.hadoop.hive.metastore.api.Function.getOwnerType()方法的使用及代码示例

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

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

Function.getOwnerType介绍

暂无

代码示例

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

public Object getFieldValue(_Fields field) {
 switch (field) {
 case FUNCTION_NAME:
  return getFunctionName();
 case DB_NAME:
  return getDbName();
 case CLASS_NAME:
  return getClassName();
 case OWNER_NAME:
  return getOwnerName();
 case OWNER_TYPE:
  return getOwnerType();
 case CREATE_TIME:
  return getCreateTime();
 case FUNCTION_TYPE:
  return getFunctionType();
 case RESOURCE_URIS:
  return getResourceUris();
 case CAT_NAME:
  return getCatName();
 }
 throw new IllegalStateException();
}

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

private MFunction convertToMFunction(Function func) throws InvalidObjectException {
 if (func == null) {
  return null;
 }
 MDatabase mdb = null;
 String catName = func.isSetCatName() ? func.getCatName() : getDefaultCatalog(conf);
 try {
  mdb = getMDatabase(catName, func.getDbName());
 } catch (NoSuchObjectException e) {
  LOG.error("Database does not exist", e);
  throw new InvalidObjectException("Database " + func.getDbName() + " doesn't exist.");
 }
 MFunction mfunc = new MFunction(func.getFunctionName(),
   mdb,
   func.getClassName(),
   func.getOwnerName(),
   func.getOwnerType().name(),
   func.getCreateTime(),
   func.getFunctionType().getValue(),
   convertToMResourceUriList(func.getResourceUris()));
 return mfunc;
}

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

assertEquals("function class name", className, func.getClassName());
assertEquals("function owner name", owner, func.getOwnerName());
assertEquals("function owner type", PrincipalType.USER, func.getOwnerType());
assertEquals("function type", funcType, func.getFunctionType());
List<ResourceUri> resources = func.getResourceUris();

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

private void validateFunctionInfo(Function func) throws InvalidObjectException, MetaException {
 if (func == null) {
  throw new MetaException("Function cannot be null.");
 }
 if (func.getFunctionName() == null) {
  throw new MetaException("Function name cannot be null.");
 }
 if (func.getDbName() == null) {
  throw new MetaException("Database name in Function cannot be null.");
 }
 if (!MetaStoreUtils.validateName(func.getFunctionName(), null)) {
  throw new InvalidObjectException(func.getFunctionName() + " is not a valid object name");
 }
 String className = func.getClassName();
 if (className == null) {
  throw new InvalidObjectException("Function class name cannot be null");
 }
 if (func.getOwnerType() == null) {
  throw new MetaException("Function owner type cannot be null.");
 }
 if (func.getFunctionType() == null) {
  throw new MetaException("Function type cannot be null.");
 }
}

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

assertEquals("function class name", className, func.getClassName());
assertEquals("function owner name", owner, func.getOwnerName());
assertEquals("function owner type", PrincipalType.USER, func.getOwnerType());
assertEquals("function type", funcType, func.getFunctionType());
List<ResourceUri> resources = func.getResourceUris();

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

Assert.assertEquals(function.getClassName(), createdFunction.getClassName());
Assert.assertEquals(function.getOwnerName(), createdFunction.getOwnerName());
Assert.assertEquals(function.getOwnerType(), createdFunction.getOwnerType());
Assert.assertEquals(function.getFunctionType(), createdFunction.getFunctionType());
Assert.assertEquals(function.getResourceUris(), createdFunction.getResourceUris());

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

Assert.assertEquals("Comparing OwnerName", newFunction.getOwnerName(),
  alteredFunction.getOwnerName());
Assert.assertEquals("Comparing OwnerType", newFunction.getOwnerType(),
  alteredFunction.getOwnerType());
Assert.assertEquals("Comparing ClassName", newFunction.getClassName(),
  alteredFunction.getClassName());

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

public Object getFieldValue(_Fields field) {
 switch (field) {
 case FUNCTION_NAME:
  return getFunctionName();
 case DB_NAME:
  return getDbName();
 case CLASS_NAME:
  return getClassName();
 case OWNER_NAME:
  return getOwnerName();
 case OWNER_TYPE:
  return getOwnerType();
 case CREATE_TIME:
  return Integer.valueOf(getCreateTime());
 case FUNCTION_TYPE:
  return getFunctionType();
 case RESOURCE_URIS:
  return getResourceUris();
 }
 throw new IllegalStateException();
}

代码示例来源:origin: org.spark-project.hive/hive-metastore

public Object getFieldValue(_Fields field) {
 switch (field) {
 case FUNCTION_NAME:
  return getFunctionName();
 case DB_NAME:
  return getDbName();
 case CLASS_NAME:
  return getClassName();
 case OWNER_NAME:
  return getOwnerName();
 case OWNER_TYPE:
  return getOwnerType();
 case CREATE_TIME:
  return Integer.valueOf(getCreateTime());
 case FUNCTION_TYPE:
  return getFunctionType();
 case RESOURCE_URIS:
  return getResourceUris();
 }
 throw new IllegalStateException();
}

代码示例来源:origin: org.apache.hive/hive-standalone-metastore

public Object getFieldValue(_Fields field) {
 switch (field) {
 case FUNCTION_NAME:
  return getFunctionName();
 case DB_NAME:
  return getDbName();
 case CLASS_NAME:
  return getClassName();
 case OWNER_NAME:
  return getOwnerName();
 case OWNER_TYPE:
  return getOwnerType();
 case CREATE_TIME:
  return getCreateTime();
 case FUNCTION_TYPE:
  return getFunctionType();
 case RESOURCE_URIS:
  return getResourceUris();
 case CAT_NAME:
  return getCatName();
 }
 throw new IllegalStateException();
}

代码示例来源:origin: org.spark-project.hive/hive-metastore

private MFunction convertToMFunction(Function func) throws InvalidObjectException {
 if (func == null) {
  return null;
 }
 MDatabase mdb = null;
 try {
  mdb = getMDatabase(func.getDbName());
 } catch (NoSuchObjectException e) {
  LOG.error(StringUtils.stringifyException(e));
  throw new InvalidObjectException("Database " + func.getDbName() + " doesn't exist.");
 }
 MFunction mfunc = new MFunction(func.getFunctionName(),
   mdb,
   func.getClassName(),
   func.getOwnerName(),
   func.getOwnerType().name(),
   func.getCreateTime(),
   func.getFunctionType().getValue(),
   convertToMResourceUriList(func.getResourceUris()));
 return mfunc;
}

代码示例来源:origin: org.apache.hive/hive-standalone-metastore

private MFunction convertToMFunction(Function func) throws InvalidObjectException {
 if (func == null) {
  return null;
 }
 MDatabase mdb = null;
 String catName = func.isSetCatName() ? func.getCatName() : getDefaultCatalog(conf);
 try {
  mdb = getMDatabase(catName, func.getDbName());
 } catch (NoSuchObjectException e) {
  LOG.error("Database does not exist", e);
  throw new InvalidObjectException("Database " + func.getDbName() + " doesn't exist.");
 }
 MFunction mfunc = new MFunction(func.getFunctionName(),
   mdb,
   func.getClassName(),
   func.getOwnerName(),
   func.getOwnerType().name(),
   func.getCreateTime(),
   func.getFunctionType().getValue(),
   convertToMResourceUriList(func.getResourceUris()));
 return mfunc;
}

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

private MFunction convertToMFunction(Function func) throws InvalidObjectException {
 if (func == null) {
  return null;
 }
 MDatabase mdb = null;
 try {
  mdb = getMDatabase(func.getDbName());
 } catch (NoSuchObjectException e) {
  LOG.error(StringUtils.stringifyException(e));
  throw new InvalidObjectException("Database " + func.getDbName() + " doesn't exist.");
 }
 MFunction mfunc = new MFunction(func.getFunctionName(),
   mdb,
   func.getClassName(),
   func.getOwnerName(),
   func.getOwnerType().name(),
   func.getCreateTime(),
   func.getFunctionType().getValue(),
   convertToMResourceUriList(func.getResourceUris()));
 return mfunc;
}

相关文章

微信公众号

最新文章

更多