@@ -1416,16 +1416,12 @@ public TruncateTableResponse truncate_table_req(TruncateTableRequest req)
14161416 }
14171417
14181418 @ Override
1419- public List <ExtendedTableInfo > get_tables_ext (final GetTablesExtRequest req ) throws MetaException {
1419+ public List <ExtendedTableInfo > get_tables_ext (final GetTablesExtRequest req ) throws TException {
14201420 req .setCatalog (req .isSetCatalog () ? req .getCatalog () : getDefaultCatalog (conf ));
1421- try {
1422- return GetTableHandler .getTables (
1423- () -> startTableFunction ("get_tables_ext" , req .getCatalog (), req .getDatabase (), req .getTableNamePattern ()),
1424- this , req ,
1425- t -> endFunction ("get_tables_ext" , t .getLeft () != null , t .getRight ()));
1426- } catch (Exception e ) {
1427- throw handleException (e ).defaultMetaException ();
1428- }
1421+ return GetTableHandler .getTables (
1422+ () -> startTableFunction ("get_tables_ext" , req .getCatalog (), req .getDatabase (), req .getTableNamePattern ()),
1423+ this , req ,
1424+ t -> endFunction ("get_tables_ext" , t .getLeft () != null , t .getRight ()));
14291425 }
14301426
14311427 @ Override
@@ -1440,17 +1436,13 @@ public GetTableResult get_table_req(GetTableRequest req) throws MetaException,
14401436
14411437 @ Override
14421438 public List <TableMeta > get_table_meta (String dbnames , String tblNames , List <String > tblTypes )
1443- throws MetaException , NoSuchObjectException {
1439+ throws TException {
14441440 String [] parsedDbName = parseDbName (dbnames , conf );
1445- try {
1446- return GetTableHandler .getTables (
1447- () -> startTableFunction ("get_table_metas" , parsedDbName [CAT_NAME ], parsedDbName [DB_NAME ], tblNames ),
1448- this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbnames , conf )
1449- .byType (tblTypes != null ? String .join ("," , tblTypes ) : null , tblNames ).forTableMeta (),
1450- t -> endFunction ("get_table_metas" , t .getLeft () != null , t .getRight (), join (t .getLeft (), "," )));
1451- } catch (Exception e ) {
1452- throw handleException (e ).defaultMetaException ();
1453- }
1441+ return GetTableHandler .getTables (
1442+ () -> startTableFunction ("get_table_metas" , parsedDbName [CAT_NAME ], parsedDbName [DB_NAME ], tblNames ),
1443+ this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbnames , conf )
1444+ .byType (tblTypes != null ? String .join ("," , tblTypes ) : null , tblNames ).forTableMeta (),
1445+ t -> endFunction ("get_table_metas" , t .getLeft () != null , t .getRight (), join (t .getLeft (), "," )));
14541446 }
14551447
14561448 /**
@@ -1472,23 +1464,15 @@ public Table get_table_core(GetTableRequest getTableRequest) throws MetaExceptio
14721464 * are retrievable from the database specified by "dbnames."
14731465 * There is no guarantee of the order of the returned tables.
14741466 * If there are duplicate names, only one instance of the table will be returned.
1475- * @throws MetaException
1476- * @throws InvalidOperationException
1477- * @throws UnknownDBException
1467+ * @throws TException
14781468 */
14791469 @ Override
14801470 public GetTablesResult get_table_objects_by_name_req (GetTablesRequest req ) throws TException {
1481- try {
1482- List <Table > tables = GetTableHandler .getTables (
1483- () -> startMultiTableFunction ("get_multi_table" , req .getDbName (), req .getTblNames ()),
1484- this , req ,
1485- t -> endFunction ("get_multi_table" , t .getLeft () != null , t .getRight (), join (req .getTblNames (), "," )));
1486- return new GetTablesResult (tables );
1487- } catch (Exception e ) {
1488- throw handleException (e )
1489- .throwIfInstance (MetaException .class , InvalidOperationException .class , UnknownDBException .class )
1490- .defaultMetaException ();
1491- }
1471+ List <Table > tables = GetTableHandler .getTables (
1472+ () -> startMultiTableFunction ("get_multi_table" , req .getDbName (), req .getTblNames ()),
1473+ this , req ,
1474+ t -> endFunction ("get_multi_table" , t .getLeft () != null , t .getRight (), join (req .getTblNames (), "," )));
1475+ return new GetTablesResult (tables );
14921476 }
14931477
14941478 @ Override
@@ -1499,17 +1483,11 @@ public void update_creation_metadata(String catName, final String dbName, final
14991483 @ Override
15001484 public List <String > get_table_names_by_filter (
15011485 final String dbName , final String filter , final short maxTables )
1502- throws MetaException , InvalidOperationException , UnknownDBException {
1503- try {
1504- return GetTableHandler .getTables (
1505- () -> startFunction ("get_table_names_by_filter" , ": db = " + dbName + ", filter = " + filter ),
1506- this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbName , conf ).byFilter (filter , maxTables ),
1507- t -> endFunction ("get_table_names_by_filter" , t .getLeft () != null , t .getRight (), join (t .getLeft (), "," )));
1508- } catch (Exception e ) {
1509- throw handleException (e )
1510- .throwIfInstance (MetaException .class , InvalidOperationException .class , UnknownDBException .class )
1511- .defaultMetaException ();
1512- }
1486+ throws TException {
1487+ return GetTableHandler .getTables (
1488+ () -> startFunction ("get_table_names_by_filter" , ": db = " + dbName + ", filter = " + filter ),
1489+ this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbName , conf ).byFilter (filter , maxTables ),
1490+ t -> endFunction ("get_table_names_by_filter" , t .getLeft () != null , t .getRight (), join (t .getLeft (), "," )));
15131491 }
15141492
15151493 @ Override
@@ -1989,7 +1967,7 @@ public PartitionValuesResponse get_partition_values(PartitionValuesRequest reque
19891967 return resps .getFirst ();
19901968 } catch (Exception e ) {
19911969 ex = e ;
1992- throw handleException (e ).throwIfInstance ( MetaException . class ). defaultMetaException ();
1970+ throw handleException (e ).defaultMetaException ();
19931971 } finally {
19941972 endFunction ("get_partition_values" , ex == null , ex , tableName .toString ());
19951973 }
@@ -2174,27 +2152,19 @@ private void alter_table_core(String catName, String dbname, String name, Table
21742152
21752153 @ Override
21762154 public List <String > get_tables (final String dbname , final String pattern )
2177- throws MetaException {
2178- try {
2179- return GetTableHandler .getTables (() -> startFunction ("get_tables" , ": db=" + dbname + " pat=" + pattern ),
2180- this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbname , conf ).byPattern (pattern ),
2181- t -> endFunction ("get_tables" , t .getLeft () != null , t .getRight ()));
2182- } catch (Exception e ) {
2183- throw handleException (e ).defaultMetaException ();
2184- }
2155+ throws TException {
2156+ return GetTableHandler .getTables (() -> startFunction ("get_tables" , ": db=" + dbname + " pat=" + pattern ),
2157+ this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbname , conf ).byPattern (pattern ),
2158+ t -> endFunction ("get_tables" , t .getLeft () != null , t .getRight ()));
21852159 }
21862160
21872161 @ Override
21882162 public List <String > get_tables_by_type (final String dbname , final String pattern , final String tableType )
2189- throws MetaException {
2190- try {
2191- return GetTableHandler .getTables (
2192- () -> startFunction ("get_tables_by_type" , ": db=" + dbname + " pat=" + pattern + ",type=" + tableType ),
2193- this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbname , conf ).byType (tableType , pattern ),
2194- t -> endFunction ("get_tables_by_type" , t .getLeft () != null , t .getRight ()));
2195- } catch (Exception e ) {
2196- throw handleException (e ).defaultMetaException ();
2197- }
2163+ throws TException {
2164+ return GetTableHandler .getTables (
2165+ () -> startFunction ("get_tables_by_type" , ": db=" + dbname + " pat=" + pattern + ",type=" + tableType ),
2166+ this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbname , conf ).byType (tableType , pattern ),
2167+ t -> endFunction ("get_tables_by_type" , t .getLeft () != null , t .getRight ()));
21982168 }
21992169
22002170 @ Override
@@ -2235,14 +2205,10 @@ public List<String> get_materialized_views_for_rewriting(final String dbname)
22352205 }
22362206
22372207 @ Override
2238- public List <String > get_all_tables (final String dbname ) throws MetaException {
2239- try {
2240- return GetTableHandler .getTables (() -> startFunction ("get_all_tables" , ": db=" + dbname ),
2241- this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbname , conf ),
2242- t -> endFunction ("get_all_tables" , t .getLeft () != null , t .getRight ()));
2243- } catch (Exception e ) {
2244- throw handleException (e ).defaultMetaException ();
2245- }
2208+ public List <String > get_all_tables (final String dbname ) throws TException {
2209+ return GetTableHandler .getTables (() -> startFunction ("get_all_tables" , ": db=" + dbname ),
2210+ this , GetTableHandler .GetTableNamesRequest .fromDatabase (dbname , conf ),
2211+ t -> endFunction ("get_all_tables" , t .getLeft () != null , t .getRight ()));
22462212 }
22472213
22482214 private List <FieldSchema > get_fields_with_environment_context_core (String db , String tableName , final EnvironmentContext envContext )
0 commit comments