Re: Question about equality of o.a.s.sql.Row

2016-06-20 Thread dhruve ashar
In scala, "==" and "!=" are not operators but methods which are defined here as : The expression x == that is equivalent to if (x eq null) that eq null else x.*equals*(that). The expression x != that is equivalent to true if !(this == that) So

Re: Question about equality of o.a.s.sql.Row

2016-06-20 Thread Michael Armbrust
> > This is because two objects are compared by "o1 != o2" instead of > "o1.equals(o2)" at > https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/Row.scala#L408 Even equals(...) does not do what you want on the JVM: scala> Array(1,2).equals(Array(1,2))

Question about equality of o.a.s.sql.Row

2016-06-17 Thread Kazuaki Ishizaki
Dear all, I have three questions about equality of org.apache.spark.sql.Row. (1) If a Row has a complex type (e.g. Array), is the following behavior expected? If two Rows has the same array instance, Row.equals returns true in the second assert. If two Rows has different array instances (a1