本文整理了Java中org.apache.hadoop.hive.metastore.api.Function.getCatName()
方法的一些代码示例,展示了Function.getCatName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.getCatName()
方法的具体详情如下:
包路径:org.apache.hadoop.hive.metastore.api.Function
类名称:Function
方法名:getCatName
暂无
代码示例来源: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
Map<String, String> transactionalListenerResponses = Collections.emptyMap();
try {
String catName = func.isSetCatName() ? func.getCatName() : getDefaultCatalog(conf);
ms.openTransaction();
Database db = ms.getDatabase(catName, func.getDbName());
代码示例来源:origin: apache/hive
/**
* @param fnEvent function event
* @throws MetaException
*/
@Override
public void onDropFunction(DropFunctionEvent fnEvent) throws MetaException {
Function fn = fnEvent.getFunction();
DropFunctionMessage msg = MessageBuilder.getInstance().buildDropFunctionMessage(fn);
NotificationEvent event =
new NotificationEvent(0, now(), EventType.DROP_FUNCTION.toString(),
msgEncoder.getSerializer().serialize(msg));
event.setCatName(fn.isSetCatName() ? fn.getCatName() : DEFAULT_CATALOG_NAME);
event.setDbName(fn.getDbName());
process(event, fnEvent);
}
代码示例来源: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
/**
* @param fnEvent function event
* @throws MetaException
*/
@Override
public void onCreateFunction(CreateFunctionEvent fnEvent) throws MetaException {
Function fn = fnEvent.getFunction();
CreateFunctionMessage msg = MessageBuilder.getInstance()
.buildCreateFunctionMessage(fn);
NotificationEvent event =
new NotificationEvent(0, now(), EventType.CREATE_FUNCTION.toString(),
msgEncoder.getSerializer().serialize(msg));
event.setCatName(fn.isSetCatName() ? fn.getCatName() : DEFAULT_CATALOG_NAME);
event.setDbName(fn.getDbName());
process(event, fnEvent);
}
代码示例来源:origin: apache/hive
boolean success = false;
try {
String newFuncCat = newFunction.isSetCatName() ? newFunction.getCatName() :
getDefaultCatalog(conf);
if (!newFuncCat.equalsIgnoreCase(catName)) {
代码示例来源:origin: apache/hive
Assert.assertFalse(functions.contains(f2Name));
client.dropFunction(function.getCatName(), function.getDbName(), function.getFunctionName());
try {
client.getFunction(function.getCatName(), function.getDbName(), function.getFunctionName());
Assert.fail("Expected a NoSuchObjectException to be thrown");
} catch (NoSuchObjectException exception) {
代码示例来源:origin: apache/hive
Assert.assertEquals(expectedCatalog(), createdFunction.getCatName());
Assert.assertEquals(function.getClassName(), createdFunction.getClassName());
Assert.assertEquals(function.getOwnerName(), createdFunction.getOwnerName());
代码示例来源:origin: org.apache.hive.hcatalog/hive-hcatalog-server-extensions
/**
* @param fnEvent function event
* @throws MetaException
*/
@Override
public void onCreateFunction(CreateFunctionEvent fnEvent) throws MetaException {
Function fn = fnEvent.getFunction();
NotificationEvent event =
new NotificationEvent(0, now(), EventType.CREATE_FUNCTION.toString(), msgFactory
.buildCreateFunctionMessage(fn).toString());
event.setCatName(fn.isSetCatName() ? fn.getCatName() : DEFAULT_CATALOG_NAME);
event.setDbName(fn.getDbName());
process(event, fnEvent);
}
代码示例来源: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.apache.hive.hcatalog/hive-hcatalog-server-extensions
/**
* @param fnEvent function event
* @throws MetaException
*/
@Override
public void onDropFunction(DropFunctionEvent fnEvent) throws MetaException {
Function fn = fnEvent.getFunction();
NotificationEvent event =
new NotificationEvent(0, now(), EventType.DROP_FUNCTION.toString(), msgFactory
.buildDropFunctionMessage(fn).toString());
event.setCatName(fn.isSetCatName() ? fn.getCatName() : DEFAULT_CATALOG_NAME);
event.setDbName(fn.getDbName());
process(event, fnEvent);
}
代码示例来源:origin: org.apache.hive/hive-standalone-metastore
Map<String, String> transactionalListenerResponses = Collections.emptyMap();
try {
String catName = func.isSetCatName() ? func.getCatName() : getDefaultCatalog(conf);
ms.openTransaction();
Database db = ms.getDatabase(catName, func.getDbName());
代码示例来源: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: org.apache.hive/hive-standalone-metastore
boolean success = false;
try {
String newFuncCat = newFunction.isSetCatName() ? newFunction.getCatName() :
getDefaultCatalog(conf);
if (!newFuncCat.equalsIgnoreCase(catName)) {
内容来源于网络,如有侵权,请联系作者删除!