Rico Bergmann,

 

The type definitions look good and this shouldn’t cause the error you see. To 
verify this usecase, I created entity-types CustomDataSet and CustomHiveTable – 
as shown below; and was able to create an entity of type CustomHiveTable.

 

Please review the JSON you used to create the entity-instance. If all looks 
good, please send the JSON contents to enable further troubleshooting.

 

Hope this helps.

 

Madhan

 

1. Create entity types ‘CustomDataSet’ and ‘CustomHiveTable’:

{

    "entityDefs": [

        {

            "name":        "CustomDataSet",

            "category":    "ENTITY",

            "description": "Custom DataSet",

            "superTypes": [

                "DataSet"

            ],

            "attributeDefs": []

        },

        {

            "name":        "CustomHiveTable",

            "category":    "ENTITY",

            "description": "Custom HiveTable",

            "superTypes": [

                "CustomDataSet",

                "hive_table"

            ],

            "attributeDefs": []

        }

    ]

}

 

2. Create an entity instance of type ‘CustomHiveTable’:

{

  "entity": {

    "guid":     "-1",

    "typeName": "CustomHiveTable",

    "attributes": {

      "name":          "testtable",

      "qualifiedName": "default.testtable@cl1",

      "tableType":     "MANAGED_TABLE",

      "temporary":     false,

      "owner":         "hive",

      "db": {

        "typeName":         "hive_db",

        "uniqueAttributes": {

          "qualifiedName": "default@cl1"

        }

      },

      "sd": {

        "guid":     "-3",

        "typeName": "hive_storagedesc"

      },

      "columns": [

        {

          "guid":     "-4",

          "typeName": "hive_column"

        },

        {

          "guid":     "-5",

          "typeName": "hive_column"

        },

        {

          "guid":     "-6",

          "typeName": "hive_column"

        }

      ]

    }

  },

  "referredEntities": {

    "-3": {

      "guid":     "-3",

      "typeName": "hive_storagedesc",

      "attributes": {

        "qualifiedName":          "default.testtable@cl1_storage",

        "compressed":             false,

        "inputFormat":            "org.apache.hadoop.mapred.TextInputFormat",

        "location":               
"hdfs://localhost.localdomain:8020/apps/hive/warehouse/testtable",

        "numBuckets":              -1,

        "outputFormat":           
"org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat",

        "storedAsSubDirectories": false,

        "serdeInfo": {

          "typeName":   "hive_serde",

          "attributes": {

            "name":       null,

            "parameters": {

              "serialization.format": "1"

            },

            "serializationLib": 
"org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"

          }

        },

        "table": {

          "guid":     "-1",

          "typeName": "CustomHiveTable"

        }

      }

    },

    "-4": {

      "guid":     "-4",

      "typeName": "hive_column",

      "attributes": {

        "name":          "id",

        "type":          "int",

        "position":      0,

        "qualifiedName": "default.testtable.id@cl1",

        "table": {

          "guid":     "-1",

          "typeName": "CustomHiveTable"

        }

      }

    },

    "-5": {

      "guid":     "-5",

      "typeName": "hive_column",

      "attributes": {

        "name":          "name",

        "type":          "string",

        "position":      1,

        "qualifiedName": "default.testtable.name@cl1",

        "table": {

          "guid":     "-1",

          "typeName": "CustomHiveTable"

        }

      }

    },

    "-6": {

      "guid":     "-6",

      "typeName": "hive_column",

      "attributes": {

        "name":           "dob",

        "type":           "date",

        "position":       2,

        "qualifiedName": "default.testtable1.dob@cl1",

        "table": {

          "guid":     "-1",

          "typeName": "CustomHiveTable"

        }

      }

    }

  }

}

 

 

From: Rico Bergmann <rico.bergm...@external.merckgroup.com>
Reply-To: "user@atlas.apache.org" <user@atlas.apache.org>
Date: Wednesday, March 7, 2018 at 3:25 AM
To: "user@atlas.apache.org" <user@atlas.apache.org>
Subject: Problems creating an entity of a type that has cyclic inheritance

 

Hi!

 

I'm facing an issue when creating an entity of a custom defined type. The error 
log says, that "qualifiedName" can not be null. But the "qualifiedName " 
attribute is set in our JSON entity definition for sure.

 

May be the problem arrises because of cyclic dependencies in the inheritance 
graph of the types. We defined a custom type inheriting from DataSet (let us 
call it CustomDataset). Then we have another type "CustomHiveDataset" that 
inherits from our CustomDataset and the built-in type hive_table. So for 
example the type "Referenceable" (where qualifiedName is defined) is somehow 
twice in the inheritance graph. Can this cause problems?

 

Best,

Rico Bergmann.

 

 

This message and any attachment are confidential and may be privileged or 
otherwise protected from disclosure. If you are not the intended recipient, you 
must not copy this message or attachment or disclose the contents to any other 
person. If you have received this transmission in error, please notify the 
sender immediately and delete the message and any attachment from your system. 
Merck KGaA, Darmstadt, Germany and any of its subsidiaries do not accept 
liability for any omissions or errors in this message which may arise as a 
result of E-Mail-transmission or for damages resulting from any unauthorized 
changes of the content of this message and any attachment thereto. Merck KGaA, 
Darmstadt, Germany and any of its subsidiaries do not guarantee that this 
message is free of viruses and does not accept liability for any damages caused 
by any virus transmitted therewith.

 

Click http://www.merckgroup.com/disclaimer to access the German, French, 
Spanish and Portuguese versions of this disclaimer.

Reply via email to