Hi everyone! What is the proper way to extract js...
# troubleshooting
a
Hi everyone! What is the proper way to extract jsonb fields from postgres and load on another postgres instance? Right now my pipeline is breaking unless I override the schema generated, explicitly setting the field type as “object”
On my case, I have a field column called
mapping
of type jsonb. The properties.json generated by tap-postgres is:
Copy code
"mapping": {},
The pipeline will only work when I manually set it to:
Copy code
"mapping": {
  "type": [
    "object"
  ]
},
Which I’m actually doing via meltano.yml schema property:
Copy code
schema:
  public-table_name:
    mapping:
      type:
        - object
When loading on target-jsonl it works fine, so I’d also appreciate an indication on where to investigate it further, I’m not sure if this is a tap-postgres or target-postgres issue
e
Hi Andrio 👋 Which variant of tap-postgres and target-postgres are you using?
a
Hi Edgar! I’m using meltanolabs variant on both tap and target
e
Ok, I think the issue in the tap is caused by https://github.com/MeltanoLabs/tap-postgres/pull/239.
Right now my pipeline is breaking unless I override the schema generated
Is it a schema validation failure?
a
I don’t think it is a scheme validation failure, it looks like that extraction worked fine and it broke when target-posgres tried to insert the data:
Copy code
RuntimeError: Neither type nor anyOf are present. Unable to determine type.
e
I see, thanks for sharing. That should've been fixed by https://github.com/MeltanoLabs/target-postgres/pull/183 and shipped in v0.0.8, so my guess is you're on an older version of the target?
a
You are correct, the error I shared before was using 0.0.7! I just updated to 0.0.9 and it raised a different error,
NotImplementedError
e
I see. Seems this was actually introduced by the PR I mentioned 😅. Quick fix seems to be to update the
NOTYPE
class: https://github.com/MeltanoLabs/target-postgres/issues/237
a
That’s great! I’ll try this as soon as I can!