I have the json schema for a set of json documents...
# ingestion
c
I have the json schema for a set of json documents. What would be the best way to ingest this metadata? @mammoth-bear-12532 I saw your reply to a similar question a few months ago, but the links no longer work.
h
Hi @crooked-wolf-53758, let us know if this sample recipe is what you are looking for: https://github.com/linkedin/datahub/blob/master/metadata-ingestion/examples/recipes/file_to_datahub_rest.yml. You can ingest something like this using
datahub ingest -c <your_recipe.yml>
c
thanks @helpful-optician-78938. Not quite. I have a schema in json schema for a json document. E.g, here is a json document:
Copy code
{
  "my_array": [
    {
      "a": 11,
      "b": "whatever"
    },
    {
      "a": 27,
      "b": null
    },
    {
      "a": 11,
      "b": 27
    }
  ]
}
the json schema might be:
Copy code
{
  "type": "object",
  "properties": {
    "my_array": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "a": {
                "type": "integer"
              },
              "b": {
                "type": "string",
                "format": "unnamed-format"
              }
            },
            "required": [
              "a",
              "b"
            ]
          },
          {
            "type": "object",
            "properties": {
              "a": {
                "type": "integer"
              },
              "b": {
                "type": "null"
              }
            },
            "required": [
              "a"
            ]
          },
          {
            "type": "object",
            "properties": {
              "a": {
                "type": "integer"
              },
              "b": {
                "type": "integer"
              }
            },
            "required": [
              "a",
              "b"
            ]
          }
        ]
      }
    }
  },
  "required": [
    "my_array"
  ]
}
would require
my_array
and
a
and
b
in the catalog after ingesting the json schema
m
@crooked-wolf-53758: this would require parsing the JSONSchema and emitting a canonical schema for it similar to what @helpful-optician-78938 did in
schema_util.py
for avro
👀 1