You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Chris Woodham (Jira)" <ji...@apache.org> on 2019/09/05 10:29:00 UTC
[jira] [Created] (AVRO-2548) StringType of "String" causes
logcalType converters to be ignored for field
Chris Woodham created AVRO-2548:
-----------------------------------
Summary: StringType of "String" causes logcalType converters to be ignored for field
Key: AVRO-2548
URL: https://issues.apache.org/jira/browse/AVRO-2548
Project: Apache Avro
Issue Type: Bug
Components: java, logical types
Affects Versions: 1.9.0
Reporter: Chris Woodham
I have the avro maven plugin configured like this:
```
<plugin>
<groupId>org.apache.avro</groupId>
<artifactId>avro-maven-plugin</artifactId>
<version>${avro.version}</version>
<executions>
<execution>
<goals>
<goal>schema</goal>
</goals>
<configuration>
<stringType>String</stringType>
<createSetters>false</createSetters>
<enableDecimalLogicalType>true</enableDecimalLogicalType>
<fieldVisibility>private</fieldVisibility>
<customConversions>
<conversion>
org.apache.avro.Conversions$UUIDConversion
</conversion>
</customConversions>
</configuration>
</execution>
</executions>
</plugin>
```
With the intention of using the provided `UUIDConversion` class on string fields set with the logicalType `uuid`. However, it seems like having `stringType` specified as 'String' means the converter is ignored.
If I comment out the line `<stringType>String</stringType>` then the converter is used as expected and the java classes have `UUID` types for those fields, but obviously all normal strings are now `CharSequence` objects.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)