Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Facing errors while adding attributes in TYPE - hive_table in ATLAS ?

avatar
New Member

Hi ,

I am issue with below CURL command while adding new attribute in hive_table Type in ATLAS

curl -v -u admin:admin -H "Content-Type: application/json" -X POST -d '{ "entityDefs": [ { "category": "ENTITY", "guid": "a4cd0760-dbf1-41c8-a737-c423ca62e905", "createdBy": "atlas", "updatedBy": "atlas", "version": 2, "name": "hive_table", "description": "hive_table", "typeVersion": "1.1", "options": { "schemaElementsAttribute": "columns" }, "attributeDefs": [ { "name": "new_attrib", "typeName": "string", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 1, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "db", "typeName": "hive_db", "isOptional": false, "cardinality": "SINGLE", "valuesMinCount": 1, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "createTime", "typeName": "date", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "lastAccessTime", "typeName": "date", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "comment", "typeName": "string", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "retention", "typeName": "int", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "sd", "typeName": "hive_storagedesc", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false, "constraints": [ { "type": "ownedRef" } ] }, { "name": "partitionKeys", "typeName": "array<hive_column>", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false, "constraints": [ { "type": "ownedRef" } ] }, { "name": "aliases", "typeName": "array<string>", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "columns", "typeName": "array<hive_column>", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false, "constraints": [ { "type": "ownedRef" } ] }, { "name": "parameters", "typeName": "map<string,string>", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "viewOriginalText", "typeName": "string", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "viewExpandedText", "typeName": "string", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "tableType", "typeName": "string", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": false }, { "name": "temporary", "typeName": "boolean", "isOptional": true, "cardinality": "SINGLE", "valuesMinCount": 0, "valuesMaxCount": 1, "isUnique": false, "isIndexable": true } ], "superTypes": [ "DataSet" ], "subTypes": [] }] }' http://localhost:21000/api/atlas/v2/entity/guid/a4cd0760-dbf1-41c8-a737-c423ca62e905/classifications

I replaced POST to PUT , Even i am getting error , Can u please help on this

1 ACCEPTED SOLUTION

avatar
Rising Star

I think you are using the wrong API. I believe you need to use PUT /v2/types/typedefs - see https://atlas.apache.org/api/v2/ui/index.html#!/TypesREST/resource_TypesREST_updateAtlasTypeDefs_PUT

To see the current definition of have_table you can do GET http://localhost:21000/api/atlas/v2/types/typedef/name/hive_table

View solution in original post

3 REPLIES 3

avatar
Rising Star

I think you are using the wrong API. I believe you need to use PUT /v2/types/typedefs - see https://atlas.apache.org/api/v2/ui/index.html#!/TypesREST/resource_TypesREST_updateAtlasTypeDefs_PUT

To see the current definition of have_table you can do GET http://localhost:21000/api/atlas/v2/types/typedef/name/hive_table

avatar
New Member

@Laura Ngo , Thanks for u r quick response,

I tried with POST and http://localhost:21000/api/atlas/v2/types/typedef/name/hive_table,

Command executed fine and no errors are showing

But new value is not reflected , Still its showing old attributes for that table

New attribute not added

Can you please help on this...!!!

Thanks in Advance

avatar
New Member

@Laura Ngo , I tried with POST also , Same issue, Its not reflecting