nate_atkins
02/15/2021, 4:43 PM[
{
"_id": "6013a71228304797e19c12eb",
"identifier": "usertype",
"value": [
"Base",
"Admin",
]
},
{
"_id": "6013a71228304797e19c12ec",
"identifier": "status",
"value": [
{
"name": "Prospect",
"id": "1"
},
{
"name": "PreQualification",
"id": "2"
},
}
]
It seems like I'm going to need to extract them individually and load them into different tables in Postgres.
Is there a way to write a schema for this that defines _id in a way that the target-postgres will be happy and treat the rest or the entire document as an object? I could then pull it apart with DBT in Postgres.douwe_maan
02/15/2021, 4:56 PMjsonb column for value instead of having the target attempt to denest it, the datamill-co variant is not a good choice: https://github.com/datamill-co/target-postgres/blob/8fb57db90992f7760c4eca4c1ee2631b0ab62c13/DECISIONS.md#de-nesting, and I suggest using the transferwise variant instead: https://github.com/transferwise/pipelinewise-target-postgres/blob/9470108c89b4a6f00420327ae2c66d48279d5cee/target_postgres/db_sync.py#L44-L45nate_atkins
02/15/2021, 4:58 PMnate_atkins
02/15/2021, 5:55 PMconstants:
_id:
type: string
identifier:
type: string
value:
type: stringdouwe_maan
02/15/2021, 6:15 PMtype: arraynate_atkins
02/15/2021, 6:33 PMnate_atkins
02/15/2021, 6:35 PM