danny0405 commented on code in PR #10209:
URL: https://github.com/apache/hudi/pull/10209#discussion_r1421234717
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/TestHoodieTableFactory.java:
##########
@@ -205,20 +205,31 @@ void testTableTypeCheck() {
final MockContext sourceContext1 = MockContext.getInstance(this.conf,
schema, "f2");
assertDoesNotThrow(() -> new
HoodieTableFactory().createDynamicTableSink(sourceContext1));
- // Invalid table type will throw exception
+ // Invalid table type will throw exception if the hoodie.properties does
not exist.
+ this.conf.setString(FlinkOptions.PATH, tempFile.getAbsolutePath() +
"_NOT_EXIST_TABLE_PATH");
this.conf.set(FlinkOptions.TABLE_TYPE, "INVALID_TABLE_TYPE");
final MockContext sourceContext2 = MockContext.getInstance(this.conf,
schema, "f2");
assertThrows(HoodieValidationException.class, () -> new
HoodieTableFactory().createDynamicTableSink(sourceContext2));
+ this.conf.setString(FlinkOptions.PATH, tempFile.getAbsolutePath());
- // Valid table type will be ok
- this.conf.set(FlinkOptions.TABLE_TYPE, "MERGE_ON_READ");
+ // Invalid table type will be ok if the hoodie.properties exists.
+ this.conf.set(FlinkOptions.TABLE_TYPE, "INVALID_TABLE_TYPE");
Review Comment:
Do we test the case where table config does not have table type for
`INVALID_TABLE_TYPE` ?
--
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]