Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,6 +83,14 @@ public Set<BaseTableInfo> getBaseViews() {
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{"
Expand Down
Loading