chovy-3012 commented on PR #12564: URL: https://github.com/apache/seatunnel/pull/12564#issuecomment-5923889457
Thanks @DanielLeens for the review! All four points are addressed in ad8454281: 1. **Binary branch untested** — Added `testMd5WithBytesInput` in `StringFunctionTest` that calls `StringFunction.md5` with the UTF-8 bytes of `"abc"` and asserts `900150983cd24fb0d6963f7d28e17f72`, covering the `byte[]` branch. Followed the existing `testToBase64WithBytesInput` precedent (direct method call). 2. **Non-string/non-binary inputs silently stringified** — Kept the `toString()` behavior, since it matches Hive's implicit cast for non-string args (e.g. `md5(int_col)`), and documented it in the `md5` Javadoc: non-string, non-binary values are converted via `toString()` and hashed as UTF-8, mirroring Hive's implicit cast to string. 3. **Docs signature omits binary** — Updated the signature to `MD5(string|binary) -> STRING` and the description to "string or binary value" in both `docs/en` and `docs/zh`. 4. **Mirror-style assertions** — Removed the `md5Direct` helper and the mirror assertions. Replaced `testMd5Consistency` (which only proved determinism) with `testMd5WithMultibyteUtf8`, which asserts the known vector for the multi-byte string `"你好"` (`7eca689f0d3389d9dea66ae112e5cfd7`), covering the non-ASCII UTF-8 path with a hardcoded expected value. Verification: `./mvnw spotless:apply` clean; `./mvnw -pl seatunnel-transforms-v2 test -Dtest=SQLHashFunctionsTest,StringFunctionTest` → 9/9 and 35/35, zero failures. -- 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]
