DATAMIMIC CE v4.0.0 #207
ake2l
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The largest DSL surface expansion since 1.0: weighted state machines, composite references, scriptable memstore, native DB sequences, fixed-width/XLSX/DbUnit formats, control flow — plus an agent-ready authoring toolchain over MCP. Seeded runs are now machine-independent; existing seeded projects re-baseline once (see Migration Notes).
✨ Agent-Ready DSL Authoring (MCP)
The MCP server exposes
generate,datamimic_check,datamimic_run, anddatamimic_reference— a coding agent can look up the DSL contract, lint a descriptor, dry-run it, and generate data without leaving the editor. That shortens the loop from "describe the data you need" to "validated descriptor in the repo."datamimic_checklints descriptors with DM-rules and concrete fix hints.datamimic_referenceserves element schemas, generators, targets, distributions, entities, and recipes — derived from the engine's registries, so the reference cannot drift from shipped behavior.✨ Weighted State Machines
<state-machine>and<transition>generate reusable weighted state progressions — order lifecycles, claim flows, session journeys — as a named generator.✨ Composite References
Composite
<reference>blocks map multiple target fields from the same source row — a multi-column foreign key in one declaration — including DB and MongoDB sources.✨ Scriptable Memstore and Client IDs
Declared
memstore,database, andmongodbids are available inscript=and<execute>scopes: aggregate staged data, filter it against a live table, and report — all inside the descriptor. Memstore aggregation is lenient for non-numeric cells, and a whole entity bound into a scalar DB/Mongo field is stringified deterministically.✨ Native DB Sequences with Explicit Names
SequenceTableGenerator(sequence='schema.seq_name')binds to a named Postgres sequence — ids come from the database's own counter, so generated rows interleave safely with application writes. Omitsequence=to keep the{type}_{name}_seqconvention. The enclosing<generate>/<iterate>must carry an explicitcount=— the generator partitions its id range up front.Known carve-out: An explicit
sequence=name that does not exist is auto-created starting at 1 (schema-qualified names included). A typo in the sequence name creates a fresh sequence instead of failing. Verify sequence names in dry-run before executing.✨ Value Picks, Counts, Decimals, and Numeric Distributions
Native attributes now cover weighted values, unique value picks,
minCount/maxCountrow ranges, exact decimals, bell-shaped numeric draws, and deterministic numeric sequences — no generator expression needed.unique="True"guarantees each value is picked at most once, and fails loudly when the row count exceeds the pool — size the count accordingly:Numeric range key distributions:
uniform(default per-row random draw),cumulated(bell-shaped, mean at midpoint),step/increment(ascending sequence),shuffle(deterministic strided walk),wedge(min, max, min+d, max-d, converging),bitreverse(bit-reversed counter order),fibonacci/padovan(recurrence values clipped to range),randomWalk(bounded walk from min, saturating at max).Finite positional sequences end instead of wrapping — generation stops when the sequence is exhausted — and are rejected under multiprocessing. Use single-process execution or a per-row distribution for those descriptors.
✨ Control Flow and Assertions
<execute>,<while>, and<assert>are supported for descriptor-local setup, looping, and hard quality gates: an<assert>that fails stops the run instead of shipping bad data downstream.✨ Read/Enrich Workflows:
<iterate>,<id>,<comment>, andoffset<iterate>is an alias of<generate>for read/enrich workflows,<id>an identifier-oriented alias of<key>, and<comment>inline documentation with no runtime effect.offset="N"skips the first N source rows; count defaults, page windows, cyclic wrap-around, and shuffled pools all operate on the post-offset region.offset=applies to file sources only. DB and memstore sources reject it; use selector-side skipping for those sources.(The engine's default column separator is
|; setdefaultSeparator=","on<setup>— orseparator=","per element — when reading comma CSVs.)✨ Formats and Exporters
XLSX, DbUnit, and fixed-width are now first-class formats, alongside dot-notation SQL write targets (
db.upsert) and a nativebinarytype.Fixed-width
.fcwfiles are self-describing — the first line carries the column specification; DATAMIMIC reads and writes both:✨ Region-Group Datasets
Dataset groups —
europe,western_europe,central_europe,southern_europe,eastern_europe,north_america,oceania,french, andiberia— select an eligible country per row, so one descriptor produces regionally coherent multi-country data.Improvements
Seeded runs are machine-independent. Literal generators (
pattern,values, typed keys), domain generators (names, addresses),DateTimeGenerator, and cross-pageuniquepicks now draw from host-independent RNG paths bound to<setup rngSeed>. Existing seeded projects gain cross-machine reproducibility with no DSL change; seeded output changes once — see Migration Notes.Tolerant entity field access. Entity fields resolve case and underscore differences —
person.givenNameandperson.given_nameaddress the same field, so migrated descriptors keep their spelling.CSV compatibility. Padded or aligned CSV headers are trimmed on read, so
this.nameresolves even when the file header carries surrounding whitespace..wgt.csvweighted files accept an optional header row.Script and converter ergonomics.
this,parent, androotscript-scope aliases.count="{expr}".<include uri="{...}">.Substring(start[, end])converter with Python slice semantics (string input).<generate>exports after its parent, preserving FK-safe write order.(statement, source).Migrating from Benerator
The 4.0.0 DSL surface —
<iterate>/<id>/<comment>, explicit DB sequence names,.fcwfiles, the scriptable memstore, weighted values,minCount/maxCount, and tolerant field access — closes the descriptor vocabulary gap for long-lived Benerator projects. Descriptors can be brought across with engine-level support instead of manual rewrites; JVM-specific custom script imports remain manual ports.Migration Notes from 3.x to 4.0.0
Seeded output changes. A 3.x seeded run and a 4.0.0 seeded run with the same seed produce different data. Every 4.0.0 run with the same model and seed is then stable and reproducible across machines. Re-baseline golden files.
Seeded generation now runs single-process. File/stream identity requires stable ordering, which single-process execution provides; worker count can no longer affect seeded output. This is a throughput trade-off — drop
rngSeedwhen parallel throughput matters more than reproducibility, and benchmark on your own infrastructure.Headerless
.wgt.csvfiles are rejected as sources. A weighted file without column names is valid for per-field weighted picks, not row iteration. For row iteration, include a header line such asvalue|weight.Nested
<generate>export order changed. Children now export after their parent. This preserves FK-safe write order for nested SQL inserts.count=above the source length warns and caps whencyclicis off. Prevents silent truncation.DSL backward compatibility. New attributes and elements (
offset,minCount/maxCounton<generate>,weights/uniqueon<key values>,distributionon numeric keys,sourceEntity/targetEntity,exportUri,<iterate>,<id>,<comment>,<state-machine>,<assert>,<while>) are additive. Existing 3.x XML models parse and run unchanged (except seeded output changes).Known Limitations
SequenceTableGeneratoris Postgres-only, and requires an explicitcount=on the enclosing<generate>/<iterate>(it partitions its id range up front).sequence=name that does not exist is auto-created starting at 1. A typo can create a fresh sequence instead of failing. Verify in dry-run.offset=applies to file sources only. DB and memstore sources reject it; use selector-side skipping for those sources.|; comma CSVs needdefaultSeparator=","on<setup>orseparator=","on the element.This discussion was created from the release DATAMIMIC CE v4.0.0.
All reactions