the-other-tim-brown commented on code in PR #6761:
URL: https://github.com/apache/hudi/pull/6761#discussion_r982708506
##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/ProtoConversionUtil.java:
##########
@@ -80,17 +83,19 @@ public static GenericRecord convertToAvro(Schema schema,
Message message) {
* 2. Convert directly from a protobuf {@link Message} to a {@link
GenericRecord} while properly handling enums and wrapped primitives mentioned
above.
*/
private static class AvroSupport {
+ private static final Schema STRING_SCHEMA =
Schema.create(Schema.Type.STRING);
+ private static final Schema NULL_SCHEMA = Schema.create(Schema.Type.NULL);
+ private static final String OVERFLOW_DESCRIPTOR_FIELD_NAME =
"descriptor_full_name";
+ private static final String OVERFLOW_BYTES_FIELD_NAME = "proto_bytes";
+ private static final Schema RECURSION_OVERFLOW_SCHEMA =
Schema.createRecord("recursion_overflow", null, "org.apache.hudi.proto", false,
Review Comment:
Yes, that's where the name of the type is coming through. Remember that the
name of a record and the name of a field are different but both use "name" in
the avro schema definition. Line 56 is the field name. The record name is more
like a class name in java where it can be defined once and reused for different
variables. You can see this down at [line
141](https://github.com/apache/hudi/pull/6761/files#diff-c4931766d3118fdebd1fb97fce4b5c36923f6bd66f6226adbfba1dd7ec2ddbd4R141)
where the type is simply `"type" : [ "null",
"org.apache.hudi.proto.recursion_overflow" ]`
--
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]