adonis0147 commented on code in PR #20095:
URL: https://github.com/apache/doris/pull/20095#discussion_r1206314963
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/DatabaseIf.java:
##########
@@ -172,6 +172,19 @@ default T getTableOrMetaException(String tableName,
List<TableIf.TableType> tabl
return table;
}
+ default T getTableOrMetaException(String tableName, TableIf.TableType...
tableTypes)
+ throws MetaNotFoundException {
+ T table = getTableOrMetaException(tableName);
+ for (TableIf.TableType tableType : tableTypes) {
+ if (table.getType() == tableType) {
+ return table;
+ }
+ }
+ throw new MetaNotFoundException(
+ "Tye type of " + tableName + " doesn't match, expected data
tables=" + tableTypes);
+
+ }
+
Review Comment:
The definition of this method looks similar as the above one (`default T
getTableOrMetaException(String tableName, List<TableIf.TableType> tableTypes)
throws MetaNotFoundException`). We should reuse the same logic.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]