I am from a Java background and new to Scala.
I am using Scala and Spark. But I'm not able to understand where I use ==and ===.
Could anyone let me know in which scenario I need to use these two operators, and what's are difference between == and ===?
解决方案
The "==" is using the equals methods which checks if the two references point to the same object. The definition of "===" depends on the context/object. For Spark , "===" is using the equalTo method.
See
(Since you are referencing Spark:) An important difference for Spark is the return value. For Column:
== returns a boolean
=== returns a column (which contains the result of the comparisons of the elements of two columns)