Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-39802

Support recursive references in Avro schemas in Spark

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.4.0
    • None
    • SQL
    • None

    Description

      This is a follow-up for https://issues.apache.org/jira/browse/SPARK-25718

      It would be great if Spark could support recursive references in Avro schemas as currently this is disabled and the following exception is thrown: 

      org.apache.spark.sql.avro.IncompatibleSchemaException: Found recursive reference in Avro schema, which can not be processed by Spark: {
        "type": "record",
        "name": "Struct",
        "fields": [
          {
            "name": "fields",
            "type": [
              "null",
              {
                "type": "array",
                "items": {
                  "type": "record",
                  "name": "fields",
                  "fields": [
                    {
                      "name": "value",
                      "type": [
                        "null",
                        "string"
                      ],
                      "default": null
                    }
                  ]
                }
              }
            ],
            "default": null
          }
        ]
      }

      I would appreciate it if someone could comment on the overall effort to make recursive Avro schemas work in Spark and whether or not there are any API restrictions that could potentially hinder the implementation, thanks.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ivan.sadikov Ivan Sadikov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: