Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3626

Unable to add a Custom LogicalType before compiling the Schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 1.11.1
    • None
    • build, java, logical types
    • None

    Description

      I'm using Maven to build my project. I'm trying to add my custom LogicalType (e.g. GenericDate another implementation of DateConversion). When the Maven project is building with customLogicalTypeFactories and customConversions tags, I'm getting the following error :

      Failed to execute goal org.apache.avro:avro-maven-plugin:1.11.1:schema (schemas) on project atlas_v: Error compiling protocol file [file.avsc] to atlas-v\src\main\java
      <customLogicalTypeFactories>
      <logicalTypeFactory>com.vadis.utils_avro.GenericDateLogicalTypeFactory</logicalTypeFactory>
      </customLogicalTypeFactories>
      <customConversions>
      <customConversion>com.vadis.utils_avro.GenericDateConversion</customConversion>
      </customConversions>

      It would be my build which is looking for my custom LogicalType (whereas they are inside my project itself) to be automatically generated by Avro.

      Then, I specify to Avro to "register" my LogicalType :

      LogicalTypes.register("generic_data", new GenericDateLogicalTypeFactory()); 

      Should I change the build process or do you have any solution to do that ?

      Attachments

        1. GenericDateLogicalTypeFactory.java
          0.5 kB
          Florian DANIEL
        2. GenericDateLogicalType.java
          0.5 kB
          Florian DANIEL
        3. GenericDateConversion.java
          1 kB
          Florian DANIEL
        4. GenericDate.java
          0.1 kB
          Florian DANIEL

        Activity

          People

            Unassigned Unassigned
            floriandaniel Florian DANIEL
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: