Created 03-14-2018 11:09 AM
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
Created 03-14-2018 04:10 PM
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
Created 03-14-2018 04:10 PM
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
Created 03-15-2018 08:23 AM
@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
Created 03-16-2018 07:30 AM
@Laura Ngo , I tried with POST also , Same issue, Its not reflecting