datahelix icon indicating copy to clipboard operation
datahelix copied to clipboard

Unique field constraint is ignored using inMap

Open semisft opened this issue 5 years ago • 0 comments

Bug report

Description of the bug

Using unique field constraint is ignored using inMap.

Steps to reproduce:

Using the profile

{
	"fields": [
		{
			"name": "number",
			"type": "integer",
			"nullable": false,
			"unique": true
		}
	],
	"constraints": [
		{
			"field": "number",
			"inMap": "numbers.csv",
			"key": "number"
		}
	]
}

with the csv file numbers.csv

number,name
1,A
2,B
3,C
4,D
5,E
6,F
7,G
8,H
9,I
10,J

Run datahelix in random mode. Here are the command line arguments I used to run the profile:

generate
--max-rows=10
--replace
--profile-file=D:\path\to\helix\profile.json
--output-path=D:\path\to\helix\out.csv
--output-format=csv
--generation-type=RANDOM
--set-from-file-directory=D:\path\to\helix

Expected result:

Unique rows are generated from 1 to 10.

Actual result:

Duplicate values are generated.

number
1
5
5
2
1
7
4
7
3
2

semisft avatar Oct 14 '20 08:10 semisft