yujun777 commented on code in PR #62453:
URL: https://github.com/apache/doris/pull/62453#discussion_r3115880180


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/stream/BaseTableStream.java:
##########
@@ -163,4 +164,32 @@ public void write(DataOutput out) throws IOException {
     // @param dataBatch the data batch to fill
     // DB_NAME, STREAM_NAME, STREAM_ID, UNIT, CONSUMPTION_STATUS, LAG, 
LAST_CONSUMPTION_TIME
     abstract void fillTableStreamConsumptionInfo(List<TRow> dataBatch);
+
+    public <E extends Exception> TableIf 
getBaseTableOrException(java.util.function.Function<String, E> e)
+            throws E {
+        TableIf table = getBaseTableNullable();
+        if (table == null) {
+            throw e.apply(streamTableInfo.getTableName());
+        }
+        return table;
+    }
+
+    public TableIf getBaseTableOrNereidsAnalysisException() throws 
AnalysisException {
+        return getBaseTableOrException(
+                t -> new AnalysisException(String.format("Unknown base table 
'%s'", t)));
+    }
+
+    public TableIf getBaseTableOrRuntimeException() throws RuntimeException {

Review Comment:
   neredis AnalysisException is also a runtime exception,  why add another 
throw runtime exception here



-- 
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]

Reply via email to