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

allow ability to fail codegen on invalid logic tpye

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.10.2
    • None
    • java, tools
    • None

    Description

      I accidentally had a field in an .avsc file that looked like this:

        {
          "name": "date",
            "type": [
              "null",
              { 
                "type": "long",
                "logicalType": "date" 
              }
            ],
      

      Running the avro-maven-plugin's schema goal, I see this warning:

      Ignoring invalid logical type for name: date

      The 'fix' was to change the type from "long" to "int", but two things surprised me here:

      1. this continued on creating a logical type of `timestamp-millis` (I think, resulting java data type was java.time.Instant)
      2. there is no way I can see to fail on warning

      Ideally I'd want to be able to configure the codegen task to fail if the type is not defined correctly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            drobert Daniel Robert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: