Not able to retrieve entity details through Metada...
# getting-started
w
Not able to retrieve entity details through Metadata Service. When I try to retrieve an entity by executing:
curl '<http://localhost:8080/entities/urn:li:dataset:(urn:li:dataPlatform:cg,kv_entity,PROD)>'
I see only this much:
Copy code
{
  "value": {
    "com.linkedin.metadata.snapshot.DatasetSnapshot": {
      "urn": "urn:li:dataset:(urn:li:dataPlatform:cg,kv_entity,PROD)",
      "aspects": [
        {
          "com.linkedin.metadata.key.DatasetKey": {
            "origin": "PROD",
            "name": "kv_entity",
            "platform": "urn:li:dataPlatform:cg"
          }
        }
      ]
    }
  }
}
However, when I created this cg dataset snapshot, I had this structure:
Copy code
"auditHeader": null,
  "proposedSnapshot": {
    "com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": {
      "urn": "urn:li:dataset:(urn:li:dataPlatform:cg,kv_entity,PROD)",
      "aspects": [
        {
          "com.linkedin.pegasus2avro.common.BrowsePaths": {
            "paths": ["/prod/cg/kv_entity"]
          }
        },
        {
          "com.linkedin.pegasus2avro.dataset.DatasetProperties": {
            "description": "kv_entity collections",
            "tags": [],
            "customProperties": {
              "db_cluster_setup_confluence_link": "https://<....wiki link here...>",
              "doc_author": "<mailto:abc.aaa@example.com|abc.aaa@example.com>"
            }
          }
        },
        {
          "com.linkedin.pegasus2avro.common.Ownership": {
            "owners": [
              {
                "owner": "urn:li:corpuser:cg_owner",
                "type": "DATAOWNER",
                "source": null
              }
            ],
            "lastModified": {
              "time": 1633345222224,
              "actor": "urn:li:corpuser:cg_owner",
              "impersonator": null
            }
          }
        },
        {
          "com.linkedin.pegasus2avro.common.InstitutionalMemory": {
            "elements": [
              {
                "url": "<https://wiki> link to cg",
                "description": "Business Requirements for CG",
                "createStamp": {
                  "time": 1581407189000,
                  "actor": "urn:li:corpuser:cg_owner",
                  "impersonator": null
                }
              }
            ]
          }
        },
        {
          "com.linkedin.pegasus2avro.schema.SchemaMetadata": {
            "schemaName": "kv_entity",
            "platform": "urn:li:dataPlatform:cg",
            "version": 0,
            "created": {
              "time": 1581407189000,
              "actor": "urn:li:corpuser:cg_dev_01",
              "impersonator": null
            },
            "lastModified": {
              "time": 1581407189000,
              "actor": "urn:li:corpuser:cg_dev_02",
              "impersonator": null
            },
            "deleted": null,
            "dataset": null,
            "cluster": null,
            "hash": "",
            "platformSchema": {
              "com.linkedin.pegasus2avro.schema.KafkaSchema": {
                "documentSchema": "{\"type\":\"record\",\"name\":\"KVEntityCodes\",\"namespace\":\"com.linkedin.dataset\",\"doc\":\"KV Entity codes\",\"fields\":[{\"name\":\"tenant_id\",\"type\":[\"number\"]},....]}"
              }
            },
            "fields": [
              {
                "fieldPath": "[version=2.0].[type=int].tenant_id",
                "jsonPath": null,
                "nullable": false,
                "description": {
                  "string": "Tenant Id originated from .."
                },
                "type": {
                  "type": {
                    "com.linkedin.pegasus2avro.schema.NumberType": {}
                  }
                },
                "nativeDataType": "int",
                "globalTags": {
                  "tags": [{ "tag": "urn:li:tag:NeedsDocumentation" }]
                },
                "recursive": false
              },
              {
                ...
              }
            ]
            }
          }
        ]
      }
    }
  }
b
How did you ingest the Snapshot?
w
I constructed a JSON for my domain similar to the bootstrap_mce.json. Of course, I had CorpUser, CorpGroup, Dataset, Chart, Dashboard entities in my json.
b
i guess the next thing would be to confirm that you can see the ingested details in the UI and mySQL?
b
Correct ^^ Are you able to query your MySQL db? We use MySQLWorkbench
w
What is the default user/pass for MySQL installed as part of DataHub ?
b
w
I executed the following query:
*select* * *from* metadata_aspect_v2 ma *where* ma.urn = 'urn:li:dataset:(urn:li:dataPlatform:cg,kv_entity,PROD)'
..and I am able to see 7 rows for different aspects: browsePaths, dataPlatformInstance, datasetKey, datasetProperties, institutionalMemory, ownership, schemaMetadata. The schemaMetadata aspect contains all the details in fields section. Q/Observation #1: Why am I not able to see any of these in the curl based query? Q2: Does this curl command request get handled by the GMS GraphQL API layer?
b
Q2: this curl does not go through GraphQL. You’re hitting our storage service directly
I’m trying to think about why you wouldn’t see all aspects