troubleshooting

Should the schema be specified on the SOURCE or should I parse with JSON function in a separate select / insert?

Also how would you parse and flatten a JSON payload?

Qu

Quentin Gaborit

Asked on Feb 26, 2024

  • If the data in your NATS is structured, you can specify the schema or the schema location in the source definition.
  • An example for specifying schema for another source can be found in the documentation: Create Source with VPC Connection
  • When publishing a JSON payload into NATS, you can create a table with the required schema, and the data will be automatically parsed. Here's an example:
CREATE TABLE test
(
  id integer,
  name varchar,
)
WITH (
  connector='nats',
  xxxx
) FORMAT PLAIN ENCODE JSON; ```
Feb 28, 2024Edited by