Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing on default value as null for type record #118

Open
shivamsharma opened this issue Jun 7, 2019 · 0 comments
Open

Failing on default value as null for type record #118

shivamsharma opened this issue Jun 7, 2019 · 0 comments

Comments

@shivamsharma
Copy link

shivamsharma commented Jun 7, 2019

Avro hugger is failing in converting below avro schema.

{
  "date_created": "2019-06-01 18:36:20 -0753",
  "fields": [
    {
      "default": null,
      "name": "device",
      "type": {
        "name": "device_record",
        "type": "record",
        "fields": [
          {
            "default": null,
            "name": "dummy_field",
            "type": [
              "null",
              "string"
            ]
          }
        ]
      }
    }
  ],
  "name": "event",
  "namespace": "help",
  "owner": "shivam",
  "schemaVersion": 1,
  "schema_id": 1,
  "type": "record"
}

error:- Tool generate failed: java.lang.Exception: Invalid default value for field: device type:RECORD pos:0, value: null

If I remove default: null or making type as union then it works fine. But If I use avro-tools it shows just warning and convert schema to class. Can we have same functionality here also.

Note:- Can we have stacktrace print in this tool. Otherwise, it is very difficult to identify the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant