Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
zddr committed Nov 22, 2024
1 parent 61b8bde commit 22b1076
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ public void setTableName(String tableName) {

// if compatible failed due catalog dropped, ctlName will be null
public boolean isInternalTable() {
//
if (StringUtils.isEmpty(ctlName)) {
if (!StringUtils.isEmpty(ctlName)) {
return InternalCatalog.INTERNAL_CATALOG_NAME.equals(ctlName);
} else {
return InternalCatalog.INTERNAL_CATALOG_ID == ctlId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down Expand Up @@ -127,8 +128,15 @@ protected Set<MTMV> getAvailableMTMVs(Set<TableIf> usedTables, CascadesContext c

private List<MaterializationContext> createAsyncMaterializationContext(CascadesContext cascadesContext,
Set<TableIf> usedTables) {
Set<MTMV> availableMTMVs = getAvailableMTMVs(usedTables, cascadesContext);
if (availableMTMVs.isEmpty()) {
Set<MTMV> availableMTMVs;
try {
availableMTMVs = getAvailableMTMVs(usedTables, cascadesContext);
} catch (Exception e) {
LOG.warn(String.format("MaterializationContext getAvailableMTMVs generate fail, current queryId is %s",
cascadesContext.getConnectContext().getQueryIdentifier()), e);
return ImmutableList.of();
}
if (CollectionUtils.isEmpty(availableMTMVs)) {
LOG.debug("Enable materialized view rewrite but availableMTMVs is empty, current queryId "
+ "is {}", cascadesContext.getConnectContext().getQueryIdentifier());
return ImmutableList.of();
Expand Down

0 comments on commit 22b1076

Please sign in to comment.