This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new d4b11f0cd9d branch-4.1: [fix](mtmv) Add null-safety to
getBaseViewsOneLevel for backward compatibility #64412 (#64500)
d4b11f0cd9d is described below
commit d4b11f0cd9dc171b2ea00eaeaceadddf9279e41b
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jun 16 15:16:15 2026 +0800
branch-4.1: [fix](mtmv) Add null-safety to getBaseViewsOneLevel for
backward compatibility #64412 (#64500)
Cherry-picked from #64412
Co-authored-by: yujun <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
---
.../src/main/java/org/apache/doris/mtmv/MTMVRelation.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelation.java
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelation.java
index 46caf032f53..452733cf7a7 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelation.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelation.java
@@ -18,13 +18,16 @@
package org.apache.doris.mtmv;
import org.apache.doris.datasource.CatalogMgr;
+import org.apache.doris.persist.gson.GsonPostProcessable;
import com.google.gson.annotations.SerializedName;
import org.apache.commons.collections4.CollectionUtils;
+import java.io.IOException;
+import java.util.HashSet;
import java.util.Set;
-public class MTMVRelation {
+public class MTMVRelation implements GsonPostProcessable {
// t1 => v1 => v2
// t2 => mv1
// mv1 join v2 => mv2
@@ -80,6 +83,14 @@ public class MTMVRelation {
return baseViews;
}
+ @Override
+ public void gsonPostProcess() throws IOException {
+ // For backward compatibility: previously created MTMV may not have
baseViewsOneLevel
+ if (baseViewsOneLevel == null) {
+ baseViewsOneLevel = baseViews == null ? new HashSet<>() : new
HashSet<>(baseViews);
+ }
+ }
+
// toString() is not easy to find where to call the method
public String toInfoString() {
return "MTMVRelation{"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]