This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-table-store.git
The following commit(s) were added to refs/heads/master by this push:
new 9c0f3cc4 [hotfix] Optimize exception message when creating a connector
table in Table Store Catalog
9c0f3cc4 is described below
commit 9c0f3cc4d09c62ebb84efd10f0b160ea619979c8
Author: JingsongLi <[email protected]>
AuthorDate: Mon Jul 11 14:22:37 2022 +0800
[hotfix] Optimize exception message when creating a connector table in
Table Store Catalog
---
.../org/apache/flink/table/store/connector/FlinkCatalog.java | 10 ++++------
.../apache/flink/table/store/connector/FlinkCatalogTest.java | 3 ++-
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git
a/flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/FlinkCatalog.java
b/flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/FlinkCatalog.java
index a3e4bfdd..15fefe42 100644
---
a/flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/FlinkCatalog.java
+++
b/flink-table-store-connector/src/main/java/org/apache/flink/table/store/connector/FlinkCatalog.java
@@ -186,10 +186,6 @@ public class FlinkCatalog extends AbstractCatalog {
}
}
- private static ClassLoader classLoader() {
- return FlinkCatalog.class.getClassLoader();
- }
-
private UpdateSchema convertTableToSchema(ObjectPath tablePath,
CatalogBaseTable baseTable) {
if (!(baseTable instanceof CatalogTable)) {
throw new UnsupportedOperationException(
@@ -199,8 +195,10 @@ public class FlinkCatalog extends AbstractCatalog {
Map<String, String> options = table.getOptions();
if (options.containsKey(CONNECTOR.key())) {
throw new CatalogException(
- "Table Store Catalog only supports table store tables, not
Flink connector: "
- + options.get(CONNECTOR.key()));
+ String.format(
+ "Table Store Catalog only supports table store
tables, not '%s' connector."
+ + " You can create TEMPORARY table
instead.",
+ options.get(CONNECTOR.key())));
}
// remove table path
diff --git
a/flink-table-store-connector/src/test/java/org/apache/flink/table/store/connector/FlinkCatalogTest.java
b/flink-table-store-connector/src/test/java/org/apache/flink/table/store/connector/FlinkCatalogTest.java
index 8294294e..66412a77 100644
---
a/flink-table-store-connector/src/test/java/org/apache/flink/table/store/connector/FlinkCatalogTest.java
+++
b/flink-table-store-connector/src/test/java/org/apache/flink/table/store/connector/FlinkCatalogTest.java
@@ -205,7 +205,8 @@ public class FlinkCatalogTest {
assertThatThrownBy(() -> catalog.createTable(this.path1, newTable,
false))
.isInstanceOf(CatalogException.class)
.hasMessageContaining(
- "Table Store Catalog only supports table store tables,
not Flink connector: filesystem");
+ "Table Store Catalog only supports table store tables,"
+ + " not 'filesystem' connector. You can create
TEMPORARY table instead.");
}
@Test