Kin
06/03/2024, 2:27 PMth.Property(
"data_files",
th.ArrayType(
th.ObjectType(
th.Property("sequence", th.StringType),
th.Property("document_url", th.StringType, required=True),
)
)
)
The data is being loaded into a PostgreSQL database using target-postgres. The arrays are being mapped as ARRAY(JSONB)
, as noted in the README.
Note that while object types are mapped directly to jsonb, array types are mapped to a jsonb array.How do I configure the loader to map to a
JSONB
instead of a ARRAY(JSONB)
?Edgar Ramírez (Arch.dev)
06/03/2024, 3:47 PMobject
type
extractors:
- name: tap-custom
schema:
some_stream_id:
data_files:
type: ["object", "null"]
You might need to turn off schema validation.Kin
06/04/2024, 5:33 PMSink
class uses a validate_records
config (singer_sdk/sinks/core.py#L199). I tried setting that on a loader config, but I'm getting a validation error.
Failed validating 'type' in schema['properties']['data_files']
Kin
06/04/2024, 5:40 PMtarget-jsonl
loader, not target-postgres
. So, it does work for loading into a PostgreSQL table. But, it breaks the JSONL plugin.Edgar Ramírez (Arch.dev)
06/06/2024, 2:23 PM