I've been trying to setup a pipeline from mongo to...
# troubleshooting
m
I've been trying to setup a pipeline from mongo to postgres but it doesn't work well. I tried many of the variant combinations. Currently I'm on tap-mongodb singer-io variant. the schema it generates when I run
meltano invoke tap-mongodb
:
Copy code
{"type": "SCHEMA", "stream": "activities", "schema": {"type": "object", "properties:{
 "activity_date": {"anyOf": [{"type": "string", "format": "date-time"}, {}]},
 "source": {"anyOf": [{}]}, 
 "data": {"anyOf": [{}]}}}, 
 "key_properties": ["_id"]}
The errors are caused by the empty dictionaries in anyOf lists. I tried to override this with:
Copy code
schema:
  stream:
    _id:
      type: [string, null]
      format: uuid
    activity_date:
      type: string
      format: date-time
but it doesn't override fully only adds the parts I defined and keeps the rest. It's able extract data its own but schema looks flawed and throws error on load. last part of the error, called: BrokenPipeError:
Copy code
2023-05-25T21:43:43.337260Z [info     ]     return meth(self, **kw)    cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2023-05-25T21:43:43.337461Z [info     ]   File "/home/ubuntu/meltano_project/mongo-test/.meltano/loaders/target-postgres/venv/lib/python3.9/site-packages/sqlalchemy/sql/compiler.py", line 5166, in visit_null cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2023-05-25T21:43:43.337680Z [info     ]     raise exc.CompileError(    cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2023-05-25T21:43:43.337884Z [info     ] sqlalchemy.exc.CompileError: Can't generate DDL for NullType(); did you forget to specify a type on this Column? cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2023-05-25T21:43:43.434281Z [error    ]