Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Unique field constraint is ignored using inMap #1711

Open
semisft opened this issue Oct 14, 2020 · 0 comments
Open

Unique field constraint is ignored using inMap #1711

semisft opened this issue Oct 14, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@semisft
Copy link

semisft commented Oct 14, 2020

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 semisft added the bug Something isn't working label Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant