You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by yi...@apache.org on 2024/09/04 05:26:42 UTC

(hudi) branch master updated: [MINOR] Add backward compatibility test for HoodieTableConfig partition field APIs (#11824)

This is an automated email from the ASF dual-hosted git repository.

yihua pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new b1ac8e97ed9 [MINOR] Add backward compatibility test for HoodieTableConfig partition field APIs (#11824)
b1ac8e97ed9 is described below

commit b1ac8e97ed902fffa082caa54eac4fc628d8d137
Author: Lokesh Jain <lj...@apache.org>
AuthorDate: Wed Sep 4 10:56:37 2024 +0530

    [MINOR] Add backward compatibility test for HoodieTableConfig partition field APIs (#11824)
---
 .../org/apache/hudi/common/table/TestHoodieTableConfig.java   | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableConfig.java b/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableConfig.java
index 3490bc73af0..e968855b1a3 100644
--- a/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableConfig.java
+++ b/hudi-hadoop-common/src/test/java/org/apache/hudi/common/table/TestHoodieTableConfig.java
@@ -220,16 +220,17 @@ public class TestHoodieTableConfig extends HoodieCommonTestHarness {
     assertEquals("p1,p2", config.getPartitionFieldProp());
   }
 
-  @Test
-  public void testPartitionFieldAPIs() {
+  @ParameterizedTest
+  @ValueSource(strings = {"p1:simple,p2:timestamp", "p1,p2"})
+  public void testPartitionFieldAPIs(String partitionFields) {
     Properties updatedProps = new Properties();
-    updatedProps.setProperty(HoodieTableConfig.PARTITION_FIELDS.key(), "p1:simple,p2:timestamp");
+    updatedProps.setProperty(HoodieTableConfig.PARTITION_FIELDS.key(), partitionFields);
     HoodieTableConfig.update(storage, metaPath, updatedProps);
 
     HoodieTableConfig config = new HoodieTableConfig(storage, metaPath, null, null);
-    assertEquals("p1:simple,p2:timestamp", HoodieTableConfig.getPartitionFieldPropForKeyGenerator(config).get());
+    assertEquals(partitionFields, HoodieTableConfig.getPartitionFieldPropForKeyGenerator(config).get());
     assertEquals("p1,p2", HoodieTableConfig.getPartitionFieldProp(config).get());
     assertArrayEquals(new String[] {"p1", "p2"}, HoodieTableConfig.getPartitionFields(config).get());
-    assertEquals("p1", HoodieTableConfig.getPartitionFieldWithoutKeyGenPartitionType("p1:simple", config));
+    assertEquals("p1", HoodieTableConfig.getPartitionFieldWithoutKeyGenPartitionType(partitionFields.split(",")[0], config));
   }
 }