AHeise commented on code in PR #26507:
URL: https://github.com/apache/flink/pull/26507#discussion_r2060017210


##########
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroSerializationSchema.java:
##########
@@ -220,4 +226,22 @@ public boolean equals(Object o) {
     public int hashCode() {
         return Objects.hash(recordClazz, schema);
     }
+
+    /**
+     * Returns the type information of the produced type. Depending on the 
type of the record,
+     * whether it is a specific or generic record, the type information will 
be different. It can be
+     * either a {@link AvroTypeInfo} or a {@link GenericRecordAvroTypeInfo}.
+     *
+     * @return TypeInformation of the produced type
+     */
+    @Override
+    public TypeInformation getProducedType() {

Review Comment:
   This should be `TypeInformation<T>`. You probably need to cast the returns 
though but I think it makes things more explicit.



##########
flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroRowDataSerializationSchema.java:
##########
@@ -139,4 +143,14 @@ public boolean equals(Object o) {
     public int hashCode() {
         return Objects.hash(nestedSchema, rowType);
     }
+
+    @Override
+    public TypeInformation<GenericRecord> getProducedType() {
+        if (schema == null) {
+            throw new IllegalStateException(
+                    "The produced type is not available before the schema is 
initialized.");
+        } else {
+            return new GenericRecordAvroTypeInfo(schema);
+        }
+    }

Review Comment:
   Shouldn't the produced type be of row? Naively I'd expect to have the same 
type bound to 
   `SerializationSchema<RowData>, ResultTypeQueryable<GenericRecord>`



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