1
0

[HUDI-578] Trim recordKeyFields and partitionPathFields in ComplexKeyGenerator (#1281)

* [HUDI-578] Trim recordKeyFields and partitionPathFields in ComplexKeyGenerator

* add tests
This commit is contained in:
leesf
2020-01-30 08:26:26 +08:00
committed by GitHub
parent 6f34be1b8d
commit 652224edc8
2 changed files with 16 additions and 2 deletions

View File

@@ -224,6 +224,17 @@ class TestDataSourceDefaults extends AssertionsForJUnit {
case e: HoodieKeyException =>
// do nothing
}
// reset name and field1 values.
baseRecord.put("name", "name1")
baseRecord.put("field1", "field1")
val hk7 = new ComplexKeyGenerator(getKeyConfig("field1, name", "field1, name", "false")).getKey(baseRecord)
assertEquals("field1:field1,name:name1", hk7.getRecordKey)
assertEquals("field1/name1", hk7.getPartitionPath)
val hk8 = new ComplexKeyGenerator(getKeyConfig("field1,", "field1,", "false")).getKey(baseRecord)
assertEquals("field1:field1", hk8.getRecordKey)
assertEquals("field1", hk8.getPartitionPath)
}
@Test def testGlobalDeleteKeyGenerator() = {