Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/22110#discussion_r210455974 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TypeUtils.scala --- @@ -73,4 +73,14 @@ object TypeUtils { } x.length - y.length } + + /** + * Returns true if elements of the data type could be used as items of a hash set or as keys + * of a hash map. + */ + def typeCanBeHashed(dataType: DataType): Boolean = dataType match { --- End diff -- hey, this is a weird name, `byte[]` can also be hashed. I'd rather call it `typeWithProperEquals`, and document it as @mgaido91 proposed. I don't think we need to consider `hashCode` here, it's a rule in java world that equals and hashCode should be defined in a coherent way.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org