Created 10-31-2017 06:14 PM
I am not able to add a Table with columns to an existing db and Im getting below error.
{ "error": "Unable to deserialize json" }
Please see below my JSON for REST API
{ "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference", "id": { "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id", "id": "-12343", "typeName": "Table", "state": "ACTIVE" }, "typeName": "Table", "tableType": "Managed", "temporary": false, "values": { "db": "fbf39907-ad7d-4c40-9827-9f2c52c1a82c", "typeName": "Table", "name": "employee_details", "qualified_name": "employee_details", "description": "Employee Table", "owner": "Ramesh", "createTime": 1509391653, "columns": [{ "id": { "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id", "state": "ACTIVE", "typeName": "Column", "id": "-12345" }, "traitNames": [], "traits": {}, "typeName": "Column", "values": { "comment": "Employee Id", "dataType": "int", "name": "employee_id" } }, { "id": { "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id", "state": "ACTIVE", "typeName": "Column", "id": "-12384" }, "traitNames": [], "traits": {}, "typeName": "Column", "values": { "comment": "Employee Name", "dataType": "string", "name": "employee_name" } }] }, "sd": { "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference", "id": { "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id", "id": "-11893021824425523", "version": 0, "typeName": "StorageDesc", "state": "ACTIVE" }, "typeName": "StorageDesc", "values": { "location": "hdfs://host:8000/apps/warehouse/employee", "outputFormat": "TextOutputFormat", "compressed": true, "inputFormat": "TextInputFormat", "parameters": {} }, "traitNames": [], "traits": {} }, "traitNames": [], "traits": {} }
Created 10-31-2017 06:48 PM
You seem to be using v1 APIs. What version of Atlas are you working on?
Please look at this link for V2 API usage. This has some attached JSONs and CURL calls that help with table creation.
Hope this helps.
Created 10-31-2017 07:33 PM
Thanks @Ashutosh Mestry for your reply. Im using 1.0.0-SNAPSHOT version.
I tried your example with V2 API and it works. Do you have any example for Lineage too ? Thanks.
Created 10-31-2017 07:56 PM
Attached is a small sample of lineage in action.
Use the following command to import the attached ZIP. You should see lineage for the only table present in the database.
curl -g -X POST -u admin:admin -H "Content-Type: multipart/form-data" -H "Cache-Control: no-cache" -F data=@./Stocks-2.zip "http://localhost:21000/api/atlas/admin/import"
Please extract the ZIP to see the entity definition for hive_process.