flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twalthr <...@git.apache.org>
Subject [GitHub] flink pull request #6082: [FLINK-9444][table] KafkaAvroTableSource failed to...
Date Tue, 05 Jun 2018 06:59:58 GMT
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6082#discussion_r192771502
  
    --- Diff: flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroRecordClassConverter.java
---
    @@ -73,9 +75,37 @@ private AvroRecordClassConverter() {
     			final GenericTypeInfo<?> genericTypeInfo = (GenericTypeInfo<?>) extracted;
     			if (genericTypeInfo.getTypeClass() == Utf8.class) {
     				return BasicTypeInfo.STRING_TYPE_INFO;
    +			} else if (genericTypeInfo.getTypeClass() == Map.class) {
    +				// avro map key is always string
    +				return Types.MAP(Types.STRING,
    +					convertPrimitiveType(schema.getValueType().getType()));
    +			} else if (genericTypeInfo.getTypeClass() == List.class &&
    +				schema.getType() == Schema.Type.ARRAY) {
    +				return Types.LIST(convertPrimitiveType(schema.getElementType().getType()));
    --- End diff --
    
    Call this function recursively. Btw also update the method docs about this behavior.


---

Mime
View raw message