Polish DSL for data generation
-
Open
data.txtfile -
First line sets schema. Write schema columns, separated with commas. Possible columns are:
- SplitId
- It has a format
SplitId - It has a type of int/long
- Identifies a row
- It has a format
- ParentId
- It has a format
ParentId - It has a type of int/long
- Identifies a parent row
- It has a format
- Attribute
- It has a format
A{6 digit id}({dataType}) - Possible data types are:
- string:
string({max characters}) - int:
int - numeric:
numeric - date time:
datetime
- string:
- Example:
A761002(string(20))is a string Attribute with max length of 20 chars
- It has a format
- Rate
- It has a format
Rate({FrequencyPrefix}{StartYear}-{EndYear}) - Possible frequency prefixes are:
Yr- Yearly (incorrectly called Annual)Q- QuarterlyM- Monthly
- It has a type of numeric/float
- Example:
Rate(M2015-2020)is a monthly Rate range beginning in 2015 and ending in 2020
- It has a format
- Volume
- It has similar format as Rate:
Volume({FrequencyPrefix}{StartYear}-{EndYear}) - It has the same prefixes as Rate
- It has a type of int/long
- Example:
Volume(Yr2010-2011)is a yearly Volume range beginning in 2010 and ending in 2011
- It has similar format as Rate:
Example header looks like:
SplitId,A127001(int),A127002(string(20)),Rate(Q2010-2029) - SplitId
-
Next lines describes rows to generate. Possible rows are:
- Generate random:
{numberOfRows}: **. For example10: **will generate 10 random rows. - Generate random with ParentId set:
{numberOfRows}: **({parentId}). For example110: **(345)will generate 110 random rows with parentId set to 345 - Generate concrete row:
123,abc,05/03/2020 - Generate concrete row with some random values:
123,*,abcdef,1.10,12/12/1999
- Generate random:
-
Execute
-
Open
data.csvfile and see generated data