[fix](Nerids): fix function deps when check unique and not null #29797

This commit is contained in:
谢健
2024-01-11 13:16:38 +08:00
committed by yiguolei
parent f02fb5d49e
commit 885d8b28ba
4 changed files with 2734 additions and 1 deletions

View File

@ -69,7 +69,10 @@ public class FunctionalDependencies {
}
public boolean isUniqueAndNotNull(Set<Slot> slotSet) {
return slotSet.stream().noneMatch(Slot::nullable) && isUnique(slotSet);
Set<Slot> notNullSlotSet = slotSet.stream()
.filter(s -> !s.nullable())
.collect(ImmutableSet.toImmutableSet());
return isUnique(notNullSlotSet);
}
public boolean isUniformAndNotNull(Slot slot) {