clickhouse-scala-client
clickhouse-scala-client copied to clipboard
DSL v2 doesn't fully implement equality
having the following test-case you could expect that this tests passes:
val first = (2 === 2).and(3 === 3)
val second = (2 === 2).and(3 === 3)
first should be(second)
but somehow it seems object equality is not implemented fully in the new DSL v2 and fails with a
LogicalFunction(com.crobox.clickhouse.dsl.column.Magnets$$anon$36@62a60260,And,com.crobox.clickhouse.dsl.column.Magnets$$anon$36@664f03cb) was not equal to LogicalFunction(com.crobox.clickhouse.dsl.column.Magnets$$anon$36@30c9e27,And,com.crobox.clickhouse.dsl.column.Magnets$$anon$36@72663249)
Scala implements implicit conversions as anonymous function instances. Therefor these objects are not considered equal.
We could implement equals in the magnets traits, I think it will be a tedious but easy task
Failing tests on an internal project written by a certain person ;-)