docs← Back to article

Markdown for LLMs

LDC-Q3008 — Produced rows were cut to the stated cap

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# LDC-Q3008 — Produced rows were cut to the stated cap

## What it means

A query can declare several package computations, and each one costs a
run. The stated row cap bounds how many of them actually execute: when
the query declares more computations than the cap allows, the engine
runs the first ones, skips the rest, and attaches this warning to an
otherwise successful answer. The exit stays zero because rows were
returned; the warning records that some were not.

Raise the cap to cover every declared computation, or declare only the
computations the answer reads. The computations themselves stay as
written.

## Example

```run
{"argv": ["query", "$ROOT/q.lawq", "--path", "$ROOT/world.json", "--limit", "1"], "files": {"q.lawq": "let m1 = eval(\"demo.diagnostics\", \"c.json\") let m2 = eval(\"demo.diagnostics\", \"c.json\") from r in rules select r", "world.json": "{\"artifactHash\":\"sha256:6a9091bdeb56f398762394bb3ab882a8f44d541a1dd0dfd9ea65d4e9cac99d78\",\"features\":[\"core-executable\"],\"imports\":[],\"metadata\":{},\"nodes\":[{\"contentHash\":\"sha256:65449c25ae110f10c02d875734707f013f7fcae27b6c779700c6a2eb82fd00fc\",\"id\":\"urn:law:demo:diagnostics#Applicant\",\"kind\":\"type_decl\",\"name\":\"Applicant\",\"package\":\"urn:law:demo:diagnostics\",\"typeKind\":\"entity\"},{\"contentHash\":\"sha256:b62227d3c949b697a7bad486d2cd64dcd4ddaccef32710bd994226fd43e3033e\",\"id\":\"urn:law:demo:diagnostics#resident\",\"kind\":\"symbol_decl\",\"name\":\"resident\",\"package\":\"urn:law:demo:diagnostics\",\"parameters\":[{\"id\":\"urn:law:demo:diagnostics#resident/arg/a\",\"name\":\"a\",\"type\":{\"name\":\"urn:law:demo:diagnostics#Applicant\"}}],\"relationKind\":\"institutional\",\"symbolKind\":\"relation\"}],\"package\":{\"name\":\"demo.diagnostics\",\"namespace\":\"urn:law:demo:diagnostics\",\"semanticHash\":\"sha256:0000000000000000000000000000000000000000000000000000000000000000\",\"version\":\"0.1.0\"},\"schemaVersion\":\"law.core.ir/0.2\",\"semanticHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\",\"semanticVersion\":\"0.2.4\",\"strata\":[],\"theoryHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\"}", "c.json": "{}"}, "expect": "LDC-Q3008"}
```

## Fix

```run
{"argv": ["query", "$ROOT/q.lawq", "--path", "$ROOT/world.json", "--limit", "2"], "files": {"q.lawq": "let m1 = eval(\"demo.diagnostics\", \"c.json\") let m2 = eval(\"demo.diagnostics\", \"c.json\") from r in rules select r", "world.json": "{\"artifactHash\":\"sha256:6a9091bdeb56f398762394bb3ab882a8f44d541a1dd0dfd9ea65d4e9cac99d78\",\"features\":[\"core-executable\"],\"imports\":[],\"metadata\":{},\"nodes\":[{\"contentHash\":\"sha256:65449c25ae110f10c02d875734707f013f7fcae27b6c779700c6a2eb82fd00fc\",\"id\":\"urn:law:demo:diagnostics#Applicant\",\"kind\":\"type_decl\",\"name\":\"Applicant\",\"package\":\"urn:law:demo:diagnostics\",\"typeKind\":\"entity\"},{\"contentHash\":\"sha256:b62227d3c949b697a7bad486d2cd64dcd4ddaccef32710bd994226fd43e3033e\",\"id\":\"urn:law:demo:diagnostics#resident\",\"kind\":\"symbol_decl\",\"name\":\"resident\",\"package\":\"urn:law:demo:diagnostics\",\"parameters\":[{\"id\":\"urn:law:demo:diagnostics#resident/arg/a\",\"name\":\"a\",\"type\":{\"name\":\"urn:law:demo:diagnostics#Applicant\"}}],\"relationKind\":\"institutional\",\"symbolKind\":\"relation\"}],\"package\":{\"name\":\"demo.diagnostics\",\"namespace\":\"urn:law:demo:diagnostics\",\"semanticHash\":\"sha256:0000000000000000000000000000000000000000000000000000000000000000\",\"version\":\"0.1.0\"},\"schemaVersion\":\"law.core.ir/0.2\",\"semanticHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\",\"semanticVersion\":\"0.2.4\",\"strata\":[],\"theoryHash\":\"sha256:82a883cd86acd37faec9d0502a7498490966e772c41e0c750647a60f29c53010\"}", "c.json": "{}"}, "expect": "LDC-Q3008"}
```

## Engine message

The engine reports this in its own wording:

```text
LDC-Q3008: materializations truncated by explicit --limit: 1 of 2
```

## Related

- [Questions to the engine](/constructs/queries/) — how a query runs a package over a case.
- [LDC-Q3001](/diagnostics/LDC-Q3001/) — when the computation states no row cap.