Skip to content

Commit

Permalink
Merge pull request #530 from typelevel/topic/distinct-cols
Browse files Browse the repository at this point in the history
Ensure select columns are distinct in all cases
  • Loading branch information
milessabin authored Dec 12, 2023
2 parents ebbce01 + 58313ae commit f9527b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/sql/shared/src/main/scala/SqlMapping.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2197,7 +2197,7 @@ trait SqlMappingLike[F[_]] extends CirceMappingLike[F] with SqlModule[F] { self
context = context,
withs = Nil,
table = baseRef,
cols = partitionCol :: exposeCols ++ predCols,
cols = (partitionCol :: exposeCols ++ predCols).distinct,
joins = (filterJoins ++ orderJoins).distinct,
wheres = (pred1 ++ nonNullKeys ++ wheres).distinct,
orders = Nil,
Expand Down Expand Up @@ -2322,7 +2322,7 @@ trait SqlMappingLike[F[_]] extends CirceMappingLike[F] with SqlModule[F] { self
context = context,
withs = Nil,
table = baseRef,
cols = partitionCol :: distPartitionCol :: exposeCols ++ predCols,
cols = (partitionCol :: distPartitionCol :: exposeCols ++ predCols).distinct,
joins = (filterJoins ++ orderJoins).distinct,
wheres = (pred1 ++ nonNullKeys ++ wheres).distinct,
orders = Nil,
Expand Down Expand Up @@ -2443,7 +2443,7 @@ trait SqlMappingLike[F[_]] extends CirceMappingLike[F] with SqlModule[F] { self
context = context,
withs = Nil,
table = baseRef,
cols = predCols ++ distOrderCols,
cols = predCols ++ distOrderCols, // these two are individually distinct and also disjoint, hence no .distinct
joins = (filterJoins ++ orderJoins).distinct,
wheres = (pred1 ++ nonNullKeys ++ wheres).distinct,
orders = distOrders,
Expand Down

0 comments on commit f9527b0

Please sign in to comment.