diff --git a/plugin/trino-phoenix/src/main/java/io/trino/plugin/phoenix/PhoenixClient.java b/plugin/trino-phoenix/src/main/java/io/trino/plugin/phoenix/PhoenixClient.java index 98ab578ab58f..6abbfbfdf75c 100644 --- a/plugin/trino-phoenix/src/main/java/io/trino/plugin/phoenix/PhoenixClient.java +++ b/plugin/trino-phoenix/src/main/java/io/trino/plugin/phoenix/PhoenixClient.java @@ -703,6 +703,10 @@ public Map getTableProperties(ConnectorSession session, JdbcTabl } } } + catch (org.apache.phoenix.schema.TableNotFoundException e) { + // Rethrow as Trino TableNotFoundException to suppress the exception during listing information_schema + throw new io.trino.spi.connector.TableNotFoundException(new SchemaTableName(handle.getSchemaName(), handle.getTableName())); + } catch (IOException | SQLException e) { throw new TrinoException(PHOENIX_METADATA_ERROR, "Couldn't get Phoenix table properties", e); } diff --git a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java index 89434e2e22dd..7a04682ccddb 100644 --- a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java +++ b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java @@ -695,6 +695,10 @@ public Map getTableProperties(ConnectorSession session, JdbcTabl } } } + catch (org.apache.phoenix.schema.TableNotFoundException e) { + // Rethrow as Trino TableNotFoundException to suppress the exception during listing information_schema + throw new io.trino.spi.connector.TableNotFoundException(new SchemaTableName(handle.getSchemaName(), handle.getTableName())); + } catch (IOException | SQLException e) { throw new TrinoException(PHOENIX_METADATA_ERROR, "Couldn't get Phoenix table properties", e); }