Skip to content

Commit 8a46663

Browse files
authored
Merge pull request #381 from IGNF/gpu-20422_unique_null
feat(core): unique constraint on nullable fields
2 parents 918a11c + 4fc13ab commit 8a46663

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

validator-core/src/main/java/fr/ign/validator/database/internal/DuplicatedValuesFinder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public List<DuplicatedValue> findDuplicatedValues(Database database, String tabl
5151
RowIterator it = database.query(
5252
"SELECT " + columnName + " AS id, count(*) AS count"
5353
+ " FROM " + tableName
54+
+ " WHERE " + columnName + " IS NOT NULL"
5455
+ " GROUP BY " + columnName
5556
+ " HAVING count(*) > 1 ORDER BY count(*) DESC"
5657
+ " LIMIT " + LIMIT_PER_ATTRIBUTE

0 commit comments

Comments
 (0)