Uploaded image for project: 'Atlas'
  1. Atlas
  2. ATLAS-723

JSON deserialization regression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • trunk
    • 0.7-incubating
    • None
    • None

    Description

      Some json that could be deserialized prior to the implementation of soft delete can no longer be deserialized. This seems to be related to the addition of the "state" field in the id. Furthermore, it seems to be restricted to cases where the object has an array reference.

      Here's an example of a JSON object whose deserialization now fails:

       {
              "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
              "id": {
                  "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                  "id": "6765f7c6-cc11-4575-8c13-8bab9b3d86a2",
                  "version": 0,
                  "typeName": "LoadProcess"
              },
              "typeName": "LoadProcess",
              "values": {
                  "inputTables": [{
                          "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                          "id": "bacfa996-e88e-4d7e-9630-68c9829b10b4",
                          "version": 0,
                          "typeName": "Table"
                      }, {
                          "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                          "id": "6da06805-3f56-446f-8831-672a65ac2199",
                          "version": 0,
                          "typeName": "Table"
                      }
      
                  ],
                  "outputTable": {
                      "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                      "id": "d5c3d6d0-aa10-44c1-b05d-ed9400d2a5ac",
                      "version": 0,
                      "typeName": "Table"
                  },
                  "name": "loadSalesDaily"
              },
              "traitNames": [
                  "ETL"
              ],
              "traits": {
                  "ETL": {
                      "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Struct",
                      "typeName": "ETL",
                      "values": {
      
                      }
                  }
              }
          }
      

      (Note that this depends on the referenced Table objects having been previously saved into Atlas)

      I spent some time debugging this today, it seems to be a regression in the InstanceSerialization class. It seems to be related to InstanceJavaConversion.state and InstanceJavaConversion.convertId

      Attachments

        1. rb46849.patch
          4 kB
          Neeru Gupta
        2. InstanceSerializationTest.scala
          4 kB
          Jeffrey Hagelberg

        Issue Links

          Activity

            People

              guptaneeru Neeru Gupta
              jnhagelb Jeffrey Hagelberg
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: