Skip to content

Commit

Permalink
[hive] Skip checking table exists in filesystem when show tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Zouxxyy committed Dec 18, 2024
1 parent a057fd1 commit 9ffe615
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,7 @@ protected List<String> listTablesImpl(String databaseName) {
try {
Identifier identifier = new Identifier(databaseName, t);
Table table = getHmsTable(identifier);
if (isPaimonTable(identifier, table)
|| (!formatTableDisabled() && isFormatTable(table))) {
if (isPaimonTable(table) || (!formatTableDisabled() && isFormatTable(table))) {
result.add(t);
}
} catch (TableNotExistException ignored) {
Expand Down Expand Up @@ -478,7 +477,7 @@ public TableSchema getDataTableSchema(Identifier identifier) throws TableNotExis

private TableSchema getDataTableSchema(Identifier identifier, Table table)
throws TableNotExistException {
if (!isPaimonTable(identifier, table)) {
if (!isPaimonTable(table)) {
throw new TableNotExistException(identifier);
}

Expand Down Expand Up @@ -870,7 +869,7 @@ private Table renameHiveTable(Identifier fromTable, Identifier toTable) {
protected void alterTableImpl(Identifier identifier, List<SchemaChange> changes)
throws TableNotExistException, ColumnAlreadyExistException, ColumnNotExistException {
Table table = getHmsTable(identifier);
if (!isPaimonTable(identifier, table)) {
if (!isPaimonTable(table)) {
throw new UnsupportedOperationException("Only data table support alter table.");
}

Expand Down Expand Up @@ -1044,12 +1043,6 @@ public Table getHmsTable(Identifier identifier) throws TableNotExistException {
}
}

private boolean isPaimonTable(Identifier identifier, Table table) {
return isPaimonTable(table)
&& tableExistsInFileSystem(
getTableLocation(identifier, table), identifier.getBranchNameOrDefault());
}

private static boolean isPaimonTable(Table table) {
boolean isPaimonTable =
INPUT_FORMAT_CLASS_NAME.equals(table.getSd().getInputFormat())
Expand Down

0 comments on commit 9ffe615

Please sign in to comment.