morrySnow commented on code in PR #49961:
URL: https://github.com/apache/doris/pull/49961#discussion_r2053791583


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TableName.java:
##########
@@ -76,6 +80,18 @@ public TableName(String ctl, String db, String tbl) {
         this.tbl = tbl;
     }
 
+    public TableName(TableIf tableIf) {
+        String tableName = tableIf.getName();
+        DatabaseIf db = tableIf.getDatabase();

Review Comment:
   could return null, so should `check == null`



##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionUtil.java:
##########
@@ -426,6 +428,15 @@ private static boolean 
isSyncWithAllBaseTables(MTMVRefreshContext context, Strin
         return true;
     }
 
+    public static boolean isTableExcluded(Set<TableName> 
excludedTriggerTables, TableName tableNameToCheck) {
+        for (TableName tableName : excludedTriggerTables) {
+            if (tableName.like(tableNameToCheck)) {

Review Comment:
   maybe like is not appropriate impl in TableName, it is better to impl in 
this Util class, because we could not use it in other places



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TableName.java:
##########
@@ -189,6 +205,18 @@ public String toSql() {
         return stringBuilder.toString();
     }
 
+    /**
+     * if this.field is empty, we think they are like,otherwise they must 
equal to other's
+     *
+     * @param other
+     * @return
+     */
+    public boolean like(TableName other) {

Review Comment:
   check other == null



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TableName.java:
##########
@@ -76,6 +80,18 @@ public TableName(String ctl, String db, String tbl) {
         this.tbl = tbl;
     }
 
+    public TableName(TableIf tableIf) {
+        String tableName = tableIf.getName();
+        DatabaseIf db = tableIf.getDatabase();
+        CatalogIf catalog = db.getCatalog();

Review Comment:
   check null



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TableName.java:
##########
@@ -189,6 +205,18 @@ public String toSql() {
         return stringBuilder.toString();
     }
 
+    /**
+     * if this.field is empty, we think they are like,otherwise they must 
equal to other's
+     *
+     * @param other
+     * @return
+     */
+    public boolean like(TableName other) {

Review Comment:
   should explain the like does not conform to the commutative law. and notice 
user that if want to get expected result which TableName should be parameter



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/TableName.java:
##########
@@ -76,6 +80,18 @@ public TableName(String ctl, String db, String tbl) {
         this.tbl = tbl;
     }
 
+    public TableName(TableIf tableIf) {
+        String tableName = tableIf.getName();
+        DatabaseIf db = tableIf.getDatabase();
+        CatalogIf catalog = db.getCatalog();
+        if (Env.isStoredTableNamesLowerCase()) {
+            tableName = tableName.toLowerCase();

Review Comment:
   check null



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to