voonhous commented on code in PR #19809:
URL: https://github.com/apache/hudi/pull/19809#discussion_r3921264289
##########
hudi-common/src/main/java/org/apache/hudi/common/avro/HoodieAvroUtils.java:
##########
@@ -221,13 +260,13 @@ public static byte[] avroToFileBytes(IndexedRecord
record) {
* @param record The GenericRecord to convert
* @param pretty Whether to pretty-print the json output
*/
- public static String avroToJsonString(GenericRecord record, boolean pretty)
throws IOException {
+ private static String avroToJsonString(GenericRecord record, boolean pretty)
throws IOException {
return avroToJsonHelper(record, pretty).toString();
}
/**
* Convert a given avro record to a JSON string. If the record contents are
invalid, return the record.toString().
- * Use this method over {@link HoodieAvroUtils#avroToJsonString} when simply
trying to print the record contents without any guarantees around their
correctness.
+ * Use this method over {@link #avroToJson(GenericRecord, boolean)} when
simply trying to print the record contents without any guarantees around their
correctness.
Review Comment:
Dropped in 173cef432361.
##########
hudi-common/src/main/java/org/apache/hudi/common/avro/HoodieAvroUtils.java:
##########
@@ -1274,7 +1317,8 @@ private static Object
rewritePrimaryTypeWithDiffSchemaType(Object oldValue, Sche
* bytes is the result of BigDecimal.unscaledValue().toByteArray();
* This is also what Conversions.DecimalConversion.toBytes() outputs inside
a byte buffer
*/
- public static Object convertBytesToFixed(byte[] bytes, Schema schema) {
+ @VisibleForTesting
Review Comment:
Done in 0b0c95ecdcf5. `convertBytesToBigDecimal(byte[], Decimal)` and the 4-
and 6-arg `convertToRecord` are package-private with `@VisibleForTesting`
(callers: this class plus `TestHoodieAvroUtils` / `TestMercifulJsonConverter`
in the same package). `rewritePrimaryType` and the 7-arg `convertToRecord` keep
`public` with `@VisibleForTesting` because their test callers are in other
modules (`TestHoodieArrayWritableSchemaUtils` in hudi-hadoop-mr,
`TestColStatsRecordWithMetadataRecord` in hudi-spark). PR body updated: 13
narrowed, and the "kept on purpose" line now names only the 5-arg
`createNewSchemaField`.
--
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]