-
Notifications
You must be signed in to change notification settings - Fork 28.5k
[SPARK-51773][SQL] Turn file formats into case classes to properly compare them #50562
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
[SPARK-51773][SQL] Turn file formats into case classes to properly compare them #50562
Conversation
@@ -49,6 +49,10 @@ private[image] class ImageFileFormat extends FileFormat with DataSourceRegister | |||
|
|||
override def shortName(): String = "image" | |||
|
|||
override def hashCode(): Int = getClass.getCanonicalName.hashCode() | |||
|
|||
override def equals(other: Any): Boolean = other.isInstanceOf[ImageFileFormat] |
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.
Hm, the options can be different. For example, dropInvalid
can be enabled/disabled, which results in different outputs. Is this safe to assume that they are same?
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.
The options is not in the instance of ImageFileFormat
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.
Ah okie dokie
shall we simply turn them into case class? |
8438735
to
2d2fa5c
Compare
@cloud-fan hmm, might work, let me try that... |
2d2fa5c
to
1724a56
Compare
@cloud-fan I'm getting a weird documentation generation failure... Does that seem familiar to you? |
sql/hive/src/test/scala/org/apache/spark/sql/sources/SimpleTextRelation.scala
Show resolved
Hide resolved
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala
Show resolved
Hide resolved
d349e91
to
85344e1
Compare
sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala
Outdated
Show resolved
Hide resolved
sql/hive/src/test/scala/org/apache/spark/sql/sources/SimpleTextRelation.scala
Outdated
Show resolved
Hide resolved
mllib/src/main/scala/org/apache/spark/ml/source/libsvm/LibSVMRelation.scala
Outdated
Show resolved
Hide resolved
thanks, merging to master! |
What changes were proposed in this pull request?
Turn file formats into case classes to properly compare them.
Why are the changes needed?
This is necessary to make
LogicalRelation
s comparable when comparing single-pass and fixed-point Analyzer results.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing tests.
Was this patch authored or co-authored using generative AI tooling?
No.