Support Questions
Find answers, ask questions, and share your expertise

Apache Atlas Relationship Attributes

New Contributor

I am trying to add an attribute to a relationship between two entities.  It will contain an array of map string, int.  The API call works and the relationship is created but it keep saying that I am passing in null value for the attribute.

1 REPLY 1

Cloudera Employee

I hope the OP has resolved the issue as best as possible by now, but for anyone else who may find this question:

I haven't recreated this exact scenario, but I have had experiences of relationship attributes unexpectedly turning out as null, despite an apparently successful creation call.

It was only after taking the time to create a minimal example scenario, all ready for a bug report, that I recalled this one, crucial line from the API documentation for Relationships:

 

RelationshipDefs can have AttributeDefs - though only primitive types are allowed. [emphasis mine]

Given that the main Types documentation defines primitive types as "boolean, byte, short, int, long, float, double, biginteger, bigdecimal, string, date", I believe this is a plausible reason why setting the attribute as an array of map of type does not work: it is not a primitive type.

Unfortunately, I've found the surfacing of errors in Atlas to be pretty inconsistent. A lot depends on the client library you're using; often a raw curl will give you a more detailed error message, but sometimes even that is not enough, and you'll need to consult the logs directly.

In this case for example, it may have saved both of us a lot of time if there was just a higher-level check which detects trying to use non-primitive types in relationship attributes!

; ;