You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "shizhengchao (Jira)" <ji...@apache.org> on 2020/10/14 06:01:00 UTC

[jira] [Comment Edited] (FLINK-19629) English words are spelled incorrectly and an example is not provided

    [ https://issues.apache.org/jira/browse/FLINK-19629?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17213633#comment-17213633 ] 

shizhengchao edited comment on FLINK-19629 at 10/14/20, 6:00 AM:
-----------------------------------------------------------------

[~jark] Thank you for reminding me that found this bug code: 

{code:java}
private static AvroToRowDataConverter createMapConverter(LogicalType type) {
		final AvroToRowDataConverter keyConverter = createConverter(DataTypes.STRING().getLogicalType());
		final AvroToRowDataConverter valueConverter = createConverter(extractValueTypeToAvroMap(type));

		return avroObject -> {
			final Map<?, ?> map = (Map<?, ?>) avroObject;
			Map<Object, Object> result = new HashMap<>();
			for (Map.Entry<?, ?> entry : map.entrySet()) {
				Object key = keyConverter.convert(entry.getKey());
				Object value = valueConverter.convert(entry.getValue());
				result.put(key, value);
			}
			return new GenericMapData(result);
		};
	}
{code}

 if you don’t have time to fix it, I can fix it and submit the code after verification.:D




was (Author: tinny):
[~jark] Thank you for reminding me that found this bug code,  if you don’t have time to fix it, I can fix it and submit the code after verification.:D

> English words are spelled incorrectly and an example is not provided
> --------------------------------------------------------------------
>
>                 Key: FLINK-19629
>                 URL: https://issues.apache.org/jira/browse/FLINK-19629
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 1.11.2
>            Reporter: shizhengchao
>            Priority: Critical
>             Fix For: 1.12.0
>
>
> the docs Connectors/Table & SQL Connectors/Formats/Avro:
>  In addition to the types listed above, Flink supports reading/writing nullable types. Flink maps nullable types to Avro union(something, null), where something is the Avro type converted from Flink type.
> avro have no union type, should be unions:
>  Avro unions(something, null)
> by the way, an example should be provided that reading/writing nullable types, such as this:
> {code:java}
> CREATE TABLE user_behavior (
>   behavior STRING NULL
> ) WITH (
>  'connector' = 'kafka',
>  'topic' = 'user_behavior',
>  'properties.bootstrap.servers' = 'localhost:9092',
>  'properties.group.id' = 'testGroup',
>  'format' = 'avro'
> )
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)