Jolt
Reshape, rename, and validate JSON documents with declarative Bazaarvoice Jolt specs
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/jolt/index.md to help me query Jolt with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
Reshape nested JSON
Example output · captured
- Connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]');
| jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]') |
|---|
| {"Rating":3} |
Quick start
Choose where to run Jolt, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'jolt' AS jolt (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-jolt:0.5.0'
);
3. Run a query
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]');
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'jolt' AS jolt
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]');
Query Farm operates Jolt for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use jolt as the catalog alias for the query below.
4. Run a query
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]');
Technical details
- Verified connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'jolt' AS jolt (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-jolt:0.5.0'
);
Overview
Declarative JSON->JSON structural transformation via Bazaarvoice Jolt
Reshape, rename, and restructure JSON directly in SQL with declarative JSON-to-JSON transformations powered by Bazaarvoice Jolt — no imperative parsing code, no external ETL step, just a Jolt spec and a SQL query.
This extension brings Jolt's battle-tested declarative JSON transformation engine to DuckDB so data engineers, analysts, and API integrators can normalize, remap, flatten, and enrich JSON documents where the data already lives. Instead of writing language-specific code to walk and rebuild nested objects, you describe the target shape with a Jolt spec and let the engine do the structural work. It is ideal for cleaning up messy API responses, conforming event-stream payloads to a canonical schema, and reshaping nested records for downstream analytics — entirely inside your DuckDB pipeline.
Under the hood the worker embeds Bazaarvoice Jolt (Apache-2.0), the widely used JVM library for specification-driven JSON transformation. A Jolt chainr spec is a JSON array of ordered operations — shift (path-based copy/move of values into a new tree), default (supply missing keys), remove, cardinality (single↔list coercion), sort, and the modify-*-beta function operators — applied in sequence to transform an input document into an output document. The worker compiles each spec once per Arrow batch and reuses it across rows for efficient columnar execution. To learn the spec language hands-on, try the interactive Jolt demo and read the Jolt documentation.
When to reach for it
Reach for this worker whenever a JSON document arrives in the wrong shape for what comes next: keys need renaming, values need lifting out of (or nesting into) deep structures, arrays need flattening or grouping, missing fields need sensible defaults, or a heterogeneous feed needs conforming to one canonical schema. Because the transformation is a declarative spec rather than procedural code, the same query adapts to new shapes by editing the spec — not by rewriting logic.
Key concepts
- Spec-driven. You describe the target shape; Jolt does the structural walking. A full chainr spec is an ordered JSON array of operations, applied in sequence.
- Operation vocabulary.
shift(path-based copy/move),default(supply absent keys),remove,cardinality(single↔list coercion),sort, and themodify-*-betafunction operators. - Validation first. Companion predicates let a pipeline check that a spec compiles and that a payload is well-formed JSON before attempting a transform, so bad rows can be filtered rather than fault the query.
- Columnar & batched. Each spec is compiled once per Arrow batch and reused across rows, and the document column is the data vector while the spec is a query constant.
A worked example — lift a deeply nested value up to a top-level key with a full chainr spec:
SELECT jolt.jolt_transform(
'{"rating":{"primary":{"value":3}}}',
'[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]');Built and maintained by Query.Farm for the DuckDB ecosystem.
Catalog
Everything jolt exposes once attached — read straight from the worker's
released build.
main 5 functions
Declarative JSON->JSON transformation and validation functions.
Schema examples (8)
Apply a full chainr spec to lift a deeply nested rating value up to a top-level Rating key.
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]');
| jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]') |
|---|
| {"Rating":3} |
Rename and nest flat keys into a name object with a single shift operation.
SELECT jolt.main.jolt_shift('{"first":"Ada","last":"Lovelace"}', '{"first":"name.given","last":"name.family"}');
Supply default values for keys absent from the input document.
SELECT jolt.main.jolt_default('{"name":"widget"}', '{"inStock":true,"currency":"USD"}');
Guard a pipeline by checking that a string is a well-formed Jolt chainr spec before transforming.
SELECT jolt.main.is_valid_jolt_spec('[{"operation":"shift","spec":{"a":"b"}}]');
4 more examples
Check that a payload is well-formed JSON before reshaping it.
SELECT jolt.main.json_valid('{"a":[1,2,3]}');
Skip malformed payloads with json_valid, then reshape the well-formed ones with jolt_shift: row 2 is truncated JSON and is filtered out, rows 1 and 3 become {"device":...,"celsius":...} documents.
SELECT raw.id,
jolt.main.jolt_shift(raw.payload, '{"dev":"device","reading":{"c":"celsius"}}') AS normalized
FROM (VALUES (1, '{"dev":"t-1","reading":{"c":21.5}}'), (2, '{"dev":"t-2","reading":'), (3, '{"dev":"t-3","reading":{"c":19.0}}')) AS raw(id, payload)
WHERE jolt.main.json_valid(raw.payload)
ORDER BY raw.id;
Normalize nested order payloads with jolt_shift, fill the missing currency with jolt_default (USD), then total revenue per currency: EUR has 2 orders summing 40.5 and the two currency-less orders roll up as USD 49.5.
WITH orders(payload) AS (VALUES ('{"order":{"id":101,"total":{"amount":25.0,"currency":"EUR"}}}'), ('{"order":{"id":102,"total":{"amount":40.0}}}'), ('{"order":{"id":103,"total":{"amount":15.5,"currency":"EUR"}}}'), ('{"order":{"id":104,"total":{"amount":9.5}}}')), canonical AS (SELECT jolt.main.jolt_default(jolt.main.jolt_shift(orders.payload, '{"order":{"id":"order_id","total":{"amount":"amount","currency":"currency"}}}'), '{"currency":"USD"}') AS doc FROM orders) SELECT json_extract_string(canonical.doc, '$.currency') AS currency, count(*) AS order_count, sum(CAST(json_extract_string(canonical.doc, '$.amount') AS DOUBLE)) AS revenue
FROM canonical
GROUP BY currency
ORDER BY currency;
Preflight a registry of mappings before deploying them: json_valid checks each sample payload and is_valid_jolt_spec checks each chainr spec. orders_v2 misspells the shift operation (spec_ok false) and sensors_v1 has a trailing comma in its sample (sample_ok false).
SELECT m.mapping, jolt.main.json_valid(m.sample_doc) AS sample_ok,
jolt.main.is_valid_jolt_spec(m.spec) AS spec_ok
FROM (VALUES ('orders_v1', '{"order":{"id":1}}', '[{"operation":"shift","spec":{"order":{"id":"order_id"}}}]'), ('orders_v2', '{"order":{"id":2}}', '[{"operation":"shfit","spec":{"order":{"id":"order_id"}}}]'), ('sensors_v1', '{"dev":"t-1",}', '[{"operation":"default","spec":{"unit":"C"}}]')) AS m(mapping, sample_doc, spec)
ORDER BY m.mapping;
is_valid_jolt_spec (spec_json ANY)
True when the input parses and compiles as a Bazaarvoice Jolt chainr spec (a JSON array of operations).
Returns true: the input parses and compiles as a Jolt chainr spec. An unknown operation or malformed JSON returns false instead of erroring.
SELECT jolt.main.is_valid_jolt_spec('[{"operation":"shift","spec":{"a":"b"}}]');
Preflight a registry of mappings before deploying them: json_valid checks each sample payload and is_valid_jolt_spec checks each chainr spec. orders_v2 misspells the shift operation (spec_ok false) and sensors_v1 has a trailing comma in its sample (sample_ok false).
SELECT m.mapping, jolt.main.json_valid(m.sample_doc) AS sample_ok,
jolt.main.is_valid_jolt_spec(m.spec) AS spec_ok
FROM (VALUES ('orders_v1', '{"order":{"id":1}}', '[{"operation":"shift","spec":{"order":{"id":"order_id"}}}]'), ('orders_v2', '{"order":{"id":2}}', '[{"operation":"shfit","spec":{"order":{"id":"order_id"}}}]'), ('sensors_v1', '{"dev":"t-1",}', '[{"operation":"default","spec":{"unit":"C"}}]')) AS m(mapping, sample_doc, spec)
ORDER BY m.mapping;
jolt_default (input_json ANY, default_spec VARCHAR)
Apply a single Jolt 'default' operation (supply default values for keys absent from the input); default_spec is the bare default spec object. Returns JSON.
Apply a bare Jolt default spec to fill in inStock and currency keys that are absent from the input document.
SELECT jolt.main.jolt_default('{"name":"widget"}', '{"inStock":true,"currency":"USD"}');
Normalize nested order payloads with jolt_shift, fill the missing currency with jolt_default (USD), then total revenue per currency: EUR has 2 orders summing 40.5 and the two currency-less orders roll up as USD 49.5.
WITH orders(payload) AS (VALUES ('{"order":{"id":101,"total":{"amount":25.0,"currency":"EUR"}}}'), ('{"order":{"id":102,"total":{"amount":40.0}}}'), ('{"order":{"id":103,"total":{"amount":15.5,"currency":"EUR"}}}'), ('{"order":{"id":104,"total":{"amount":9.5}}}')), canonical AS (SELECT jolt.main.jolt_default(jolt.main.jolt_shift(orders.payload, '{"order":{"id":"order_id","total":{"amount":"amount","currency":"currency"}}}'), '{"currency":"USD"}') AS doc FROM orders) SELECT json_extract_string(canonical.doc, '$.currency') AS currency, count(*) AS order_count, sum(CAST(json_extract_string(canonical.doc, '$.amount') AS DOUBLE)) AS revenue
FROM canonical
GROUP BY currency
ORDER BY currency;
jolt_shift (input_json ANY, shift_spec VARCHAR)
Apply a single Jolt 'shift' operation (path-based copy/move of input values into an output tree); shift_spec is the bare shift spec object. Returns JSON.
Apply a bare Jolt shift spec to rename and nest flat input keys into a name object with given/family.
SELECT jolt.main.jolt_shift('{"first":"Ada","last":"Lovelace"}', '{"first":"name.given","last":"name.family"}');
Skip malformed payloads with json_valid, then reshape the well-formed ones with jolt_shift: row 2 is truncated JSON and is filtered out, rows 1 and 3 become {"device":...,"celsius":...} documents.
SELECT raw.id,
jolt.main.jolt_shift(raw.payload, '{"dev":"device","reading":{"c":"celsius"}}') AS normalized
FROM (VALUES (1, '{"dev":"t-1","reading":{"c":21.5}}'), (2, '{"dev":"t-2","reading":'), (3, '{"dev":"t-3","reading":{"c":19.0}}')) AS raw(id, payload)
WHERE jolt.main.json_valid(raw.payload)
ORDER BY raw.id;
SELECT jolt.main.jolt_shift('{"first":"Ada","last":"Lovelace"}', '{"first":"name.given","last":"name.family"}') AS out;
5 more examples
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]') AS out;
SELECT jolt.main.jolt_default('{"name":"widget"}', '{"inStock":true,"currency":"USD"}') AS out;
SELECT jolt.main.is_valid_jolt_spec('[{"operation":"shift","spec":{"a":"b"}}]') AS ok;
SELECT jolt.main.json_valid('{"a":[1,2,3]}') AS ok;
SELECT m.mapping, jolt.main.json_valid(m.sample_doc) AS sample_ok,
jolt.main.is_valid_jolt_spec(m.spec) AS spec_ok
FROM (VALUES ('orders_v1', '{"order":{"id":1}}', '[{"operation":"shift","spec":{"order":{"id":"order_id"}}}]'), ('orders_v2', '{"order":{"id":2}}', '[{"operation":"shfit","spec":{"order":{"id":"order_id"}}}]'), ('sensors_v1', '{"dev":"t-1",}', '[{"operation":"default","spec":{"unit":"C"}}]')) AS m(mapping, sample_doc, spec)
ORDER BY m.mapping;
jolt_transform (input_json ANY, spec_json VARCHAR)
Apply a full Bazaarvoice Jolt spec (a JSON array of shift/default/remove/cardinality/sort/modify operations) to an input JSON document; returns the transformed JSON string.
Apply a full Jolt chainr spec (a single shift operation) to lift a deeply nested value up to a top-level Rating key.
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]');
| jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]') |
|---|
| {"Rating":3} |
json_valid (input_json ANY)
True when the input parses as a well-formed JSON document.
Returns true: the input is a well-formed JSON document. Malformed JSON returns false instead of erroring.
SELECT jolt.main.json_valid('{"a":[1,2,3]}');
Skip malformed payloads with json_valid, then reshape the well-formed ones with jolt_shift: row 2 is truncated JSON and is filtered out, rows 1 and 3 become {"device":...,"celsius":...} documents.
SELECT raw.id,
jolt.main.jolt_shift(raw.payload, '{"dev":"device","reading":{"c":"celsius"}}') AS normalized
FROM (VALUES (1, '{"dev":"t-1","reading":{"c":21.5}}'), (2, '{"dev":"t-2","reading":'), (3, '{"dev":"t-3","reading":{"c":19.0}}')) AS raw(id, payload)
WHERE jolt.main.json_valid(raw.payload)
ORDER BY raw.id;
Preflight a registry of mappings before deploying them: json_valid checks each sample payload and is_valid_jolt_spec checks each chainr spec. orders_v2 misspells the shift operation (spec_ok false) and sensors_v1 has a trailing comma in its sample (sample_ok false).
SELECT m.mapping, jolt.main.json_valid(m.sample_doc) AS sample_ok,
jolt.main.is_valid_jolt_spec(m.spec) AS spec_ok
FROM (VALUES ('orders_v1', '{"order":{"id":1}}', '[{"operation":"shift","spec":{"order":{"id":"order_id"}}}]'), ('orders_v2', '{"order":{"id":2}}', '[{"operation":"shfit","spec":{"order":{"id":"order_id"}}}]'), ('sensors_v1', '{"dev":"t-1",}', '[{"operation":"default","spec":{"unit":"C"}}]')) AS m(mapping, sample_doc, spec)
ORDER BY m.mapping;
Try these queries
Rename and nest flat keys into a name object with a single shift operation.
SELECT jolt.main.jolt_shift('{"first":"Ada","last":"Lovelace"}', '{"first":"name.given","last":"name.family"}');
Uses jolt_shift
Supply default values for keys absent from the input document.
SELECT jolt.main.jolt_default('{"name":"widget"}', '{"inStock":true,"currency":"USD"}');
Uses jolt_default
Guard a pipeline by checking that a string is a well-formed Jolt chainr spec before transforming.
SELECT jolt.main.is_valid_jolt_spec('[{"operation":"shift","spec":{"a":"b"}}]');
Uses is_valid_jolt_spec
Check that a payload is well-formed JSON before reshaping it.
SELECT jolt.main.json_valid('{"a":[1,2,3]}');
Uses json_valid
Skip malformed payloads with json_valid, then reshape the well-formed ones with jolt_shift: row 2 is truncated JSON and is filtered out, rows 1 and 3 become {"device":...,"celsius":...} documents.
SELECT raw.id,
jolt.main.jolt_shift(raw.payload, '{"dev":"device","reading":{"c":"celsius"}}') AS normalized
FROM (VALUES (1, '{"dev":"t-1","reading":{"c":21.5}}'), (2, '{"dev":"t-2","reading":'), (3, '{"dev":"t-3","reading":{"c":19.0}}')) AS raw(id, payload)
WHERE jolt.main.json_valid(raw.payload)
ORDER BY raw.id;
Uses jolt_shiftjson_valid
Lift a deeply nested value to the top level with a full chainr spec.
SELECT jolt.main.jolt_transform('{"rating":{"primary":{"value":3}}}', '[{"operation":"shift","spec":{"rating":{"primary":{"value":"Rating"}}}}]') AS out;
Uses jolt_transform
6 more examples in the Catalog, each listed under the table or function it uses.
Jolt is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
XSLT
File formats & encodings
Transform and query XML documents from SQL with XSLT, XQuery and XPath
ASN.1
File formats & encodings
Decode ASN.1 BER/DER blobs and SNMP, Kerberos, LDAP, CMS, PKCS and OCSP messages into SQL rows
BSON
File formats & encodings
Query BSON documents and move them between files and tables