danny0405 commented on code in PR #10840:
URL: https://github.com/apache/hudi/pull/10840#discussion_r1517380255
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/catalog/TestHoodieCatalog.java:
##########
@@ -258,6 +267,40 @@ public void testCreateTable() throws Exception {
String keyGeneratorClassName =
metaClient.getTableConfig().getKeyGeneratorClassName();
assertEquals(keyGeneratorClassName,
SimpleAvroKeyGenerator.class.getName());
+ // validate single key and multiple partition for partitioned table
+ ObjectPath singleKeyMultiplePartitionPath = new
ObjectPath(TEST_DEFAULT_DATABASE, "tb_skmp" + System.currentTimeMillis());
+ final ResolvedCatalogTable singleKeyMultiplePartitionTable = new
ResolvedCatalogTable(
+ CatalogTable.of(
+
Schema.newBuilder().fromResolvedSchema(CREATE_TABLE_SCHEMA).build(),
+ "test",
+ Lists.newArrayList("par1,par2"),
+ EXPECTED_OPTIONS),
+ CREATE_TABLE_SCHEMA
+ );
+
+ catalog.createTable(singleKeyMultiplePartitionPath,
singleKeyMultiplePartitionTable, false);
+ metaClient =
+ StreamerUtil.createMetaClient(catalog.inferTablePath(catalogPathStr,
singleKeyMultiplePartitionPath), new org.apache.hadoop.conf.Configuration());
+ keyGeneratorClassName =
metaClient.getTableConfig().getKeyGeneratorClassName();
+ assertEquals(keyGeneratorClassName,
ComplexAvroKeyGenerator.class.getName());
Review Comment:
Personally I alway recommend to use the `assertThat` instead of
`assertEquals` because there is no confusion of the param sequence.
##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/catalog/TestHoodieCatalog.java:
##########
@@ -258,6 +267,40 @@ public void testCreateTable() throws Exception {
String keyGeneratorClassName =
metaClient.getTableConfig().getKeyGeneratorClassName();
assertEquals(keyGeneratorClassName,
SimpleAvroKeyGenerator.class.getName());
+ // validate single key and multiple partition for partitioned table
+ ObjectPath singleKeyMultiplePartitionPath = new
ObjectPath(TEST_DEFAULT_DATABASE, "tb_skmp" + System.currentTimeMillis());
+ final ResolvedCatalogTable singleKeyMultiplePartitionTable = new
ResolvedCatalogTable(
+ CatalogTable.of(
+
Schema.newBuilder().fromResolvedSchema(CREATE_TABLE_SCHEMA).build(),
+ "test",
+ Lists.newArrayList("par1,par2"),
+ EXPECTED_OPTIONS),
+ CREATE_TABLE_SCHEMA
+ );
+
+ catalog.createTable(singleKeyMultiplePartitionPath,
singleKeyMultiplePartitionTable, false);
+ metaClient =
+ StreamerUtil.createMetaClient(catalog.inferTablePath(catalogPathStr,
singleKeyMultiplePartitionPath), new org.apache.hadoop.conf.Configuration());
+ keyGeneratorClassName =
metaClient.getTableConfig().getKeyGeneratorClassName();
+ assertEquals(keyGeneratorClassName,
ComplexAvroKeyGenerator.class.getName());
Review Comment:
Personally I always recommend to use the `assertThat` instead of
`assertEquals` because there is no confusion of the param sequence.
--
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]