deepakpanda93 commented on issue #14645:
URL: https://github.com/apache/hudi/issues/14645#issuecomment-5281337783

   This issue was reviewed as part of the JIRA-migrated backlog triage.
   
   Findings: this is already covered on `master` — every key generator test 
class exercises the Spark `Row` APIs, and most also cover `InternalRow`.
   
   All key generator tests live in 
`hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/keygen/` (a 
repo-wide search finds no others):
   
   | Test class | Row coverage |
   | --- | --- |
   | `TestComplexKeyGenerator` | `Row` + `InternalRow` |
   | `TestSimpleKeyGenerator` | `Row` + `InternalRow` |
   | `TestCustomKeyGenerator` | `Row` + `InternalRow` |
   | `TestTimestampBasedKeyGenerator` | `Row` + `InternalRow` |
   | `TestNonpartitionedKeyGenerator` | `Row` |
   | `TestGlobalDeleteRecordGenerator` | `Row` |
   
   Each builds a real `Row` through the shared `KeyGeneratorTestUtilities` 
helpers — `getRow(GenericRecord)`, `getRow(GenericRecord, StructType)` and 
`getInternalRow(Row)` — and asserts key generation against it. For example, 
`TestComplexKeyGenerator#testHappyFlow` checks all three representations:
   
   ```java
   Row row = KeyGeneratorTestUtilities.getRow(avroRecord);
   assertEquals("_row_key:key1,pii_col:pi", keyGenerator.getRecordKey(row));
   assertEquals("timestamp=4357686/ts_ms=2020-03-21", 
keyGenerator.getPartitionPath(row));
   
   InternalRow internalRow = KeyGeneratorTestUtilities.getInternalRow(row);
   assertEquals(UTF8String.fromString("timestamp=4357686/ts_ms=2020-03-21"),
                keyGenerator.getPartitionPath(internalRow, row.schema()));
   ```
   
   Coverage actually goes beyond the original ask, since InternalRow is 
exercised too. The two classes under keygen/factory/ have no Row tests, but 
they cover key generator construction by type rather than key generation from a 
row, so they are out of scope for this.
   
   One caveat on attribution: this coverage accreted across many PRs rather 
than landing as a single change, so there is no one commit or release to cite — 
the evidence is the current state of the test files linked above.
   
   Closing as already covered. If a specific key generator or Row/InternalRow 
path is still untested, please open a fresh issue naming it.


-- 
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