-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24659][SQL] GenericArrayData.equals should respect element type differences #21643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,4 +104,13 @@ class ComplexDataSuite extends SparkFunSuite { | |
| // The copied data should not be changed externally. | ||
| assert(copied.getStruct(0, 1).getUTF8String(0).toString == "a") | ||
| } | ||
|
|
||
| test("SPARK-24659: GenericArrayData.equals should respect element type differences") { | ||
| // Spark SQL considers array<int> and array<long> to be incompatible, | ||
| // so an underlying implementation of array type should return false in this case. | ||
| val array1 = new GenericArrayData(Array[Int](123)) | ||
| val array2 = new GenericArrayData(Array[Long](123L)) | ||
|
|
||
| assert(!array1.equals(array2)) | ||
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any needs to handle
Array[Byte]separately above?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in java
byte[]or other primitive arrays doesn't have a properequalsimplementation.