我试图在网络上搜索其他的方式/功能,然后我得出了以下结论:
public static boolean isTableExist(Table table){
try {
table.describe();
} catch (ResourceNotFoundException e) {
return false;
}
return true;
}有没有机会摆脱试捕?
发布于 2016-12-09 12:05:05
是的,如果您只想检查表是否存在,就会这样做。但是,如果不存在,则可以使用API:TableUtils#createTableIfNotExists创建表。
发布于 2016-12-08 15:13:26
这种方式有效,不会引起问题或挂起。我不知道其他的方法。
https://stackoverflow.com/questions/41042659
复制相似问题