LXin96 commented on code in PR #10300:
URL: https://github.com/apache/hudi/pull/10300#discussion_r1426212413


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/catalog/TestHoodieHiveCatalog.java:
##########
@@ -270,6 +271,20 @@ public void testCreateNonHoodieTable() throws 
TableAlreadyExistException, Databa
     }
   }
 
+  @Test
+  public void testCreateHoodieTableWithWrongTableType() throws 
TableAlreadyExistException, DatabaseNotExistException {
+    HashMap<String,String> properties = new HashMap<>();
+    properties.put(FactoryUtil.CONNECTOR.key(), "hudi-fake");
+    properties.put("table.type","wrong type");
+    CatalogTable table =
+            new CatalogTableImpl(schema,  properties, "hudi table");
+    try {
+      hoodieCatalog.createTable(tablePath, table, false);
+    } catch (HoodieValidationException e) {
+      assertEquals("table.type's value is invalid", e.getMessage());

Review Comment:
    this patch fix the hoodie hive catalog, when using hudi hive catalog ,using 
create if not exists table , the code will go to 
org.apache.hudi.table.catalog.HoodieHiveCatalog#createTable | 
org.apache.hudi.table.catalog.HoodieHiveCatalog#instantiateHiveTable| 
org.apache.hudi.table.catalog.TableOptionProperties#translateFlinkTableProperties2Spark
 
   and in this method if the table.type is wrong it will throw npe



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to