From 65523c7c844db9998155b9ce3cf0c2cd7c874b36 Mon Sep 17 00:00:00 2001 From: Andy Coates <8012398+big-andy-coates@users.noreply.github.com> Date: Wed, 20 Nov 2019 10:18:32 +0000 Subject: [PATCH] fix: wrong source type in pull query error message (#3885) Fixes: #3523 Remove the 'table' in the error message 'Table `foo` is not materialized' as it won't always be a table: it could be a stream. --- .../pull-queries-against-materialized-aggregates.json | 2 +- .../confluent/ksql/rest/server/execution/PullQueryExecutor.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksql-functional-tests/src/test/resources/rest-query-validation-tests/pull-queries-against-materialized-aggregates.json b/ksql-functional-tests/src/test/resources/rest-query-validation-tests/pull-queries-against-materialized-aggregates.json index 0829bb11a1f6..551c91b2fdc2 100644 --- a/ksql-functional-tests/src/test/resources/rest-query-validation-tests/pull-queries-against-materialized-aggregates.json +++ b/ksql-functional-tests/src/test/resources/rest-query-validation-tests/pull-queries-against-materialized-aggregates.json @@ -719,7 +719,7 @@ ], "expectedError": { "type": "io.confluent.ksql.rest.entity.KsqlStatementErrorMessage", - "message": "Table 'X' is not materialized.", + "message": "'X' is not materialized.", "status": 400 } }, diff --git a/ksql-rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutor.java b/ksql-rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutor.java index 1a6208884cbd..b3be10e4d499 100644 --- a/ksql-rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutor.java +++ b/ksql-rest-app/src/main/java/io/confluent/ksql/rest/server/execution/PullQueryExecutor.java @@ -712,7 +712,7 @@ private static TableRowsEntity proxyTo( } private static KsqlException notMaterializedException(final SourceName sourceTable) { - return new KsqlException("Table '" + return new KsqlException("'" + sourceTable.toString(FormatOptions.noEscape()) + "' is not materialized. " + PullQueryValidator.NEW_QUERY_SYNTAX_SHORT_HELP + System.lineSeparator()