Skip to content

Commit

Permalink
[BugFix]fix npe issue for external table (#51767)
Browse files Browse the repository at this point in the history
Signed-off-by: zombee0 <[email protected]>
(cherry picked from commit 067508d)
  • Loading branch information
zombee0 authored and mergify[bot] committed Oct 15, 2024
1 parent ad70a95 commit a61785b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ private Table copyTable(Table originalTable) {
}
}

// The conception is not very clear, be careful when use it.
private static class ExternalTableCollector extends TableCollector {
List<Table> tables;
Predicate<Table> predicate;
Expand All @@ -952,9 +953,7 @@ public ExternalTableCollector(List<Table> tables, Predicate<Table> filter) {
@Override
public Void visitTable(TableRelation node, Void context) {
Table table = node.getTable();
boolean internal = CatalogMgr.isInternalCatalog(table.getCatalogName())
|| table.isNativeTableOrMaterializedView()
|| table.isOlapView();
boolean internal = table.isNativeTableOrMaterializedView() || table.isOlapView();
if (!internal && predicate.test(table)) {
tables.add(table);
}
Expand Down

0 comments on commit a61785b

Please sign in to comment.