Skip to content
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

Add Spark 3.5 support #514

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.amazon.deequ</groupId>
<artifactId>deequ</artifactId>
<version>2.0.6-spark-3.4</version>
<version>2.0.6-spark-3.5</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand All @@ -18,7 +18,7 @@
<artifact.scala.version>${scala.major.version}</artifact.scala.version>
<scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>

<spark.version>3.4.1</spark.version>
<spark.version>3.5.0</spark.version>
</properties>

<name>deequ</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.types._
import org.apache.spark.sql.catalyst.expressions.aggregate.HLLConstants._
import org.apache.spark.sql.catalyst.trees.UnaryLike
import org.apache.spark.sql.catalyst.types.DataTypeUtils

/** Adjusted version of org.apache.spark.sql.catalyst.expressions.aggregate.HyperloglogPlus */
private[sql] case class StatefulHyperloglogPlus(
Expand Down Expand Up @@ -59,7 +60,7 @@ private[sql] case class StatefulHyperloglogPlus(

override def dataType: DataType = BinaryType

override def aggBufferSchema: StructType = StructType.fromAttributes(aggBufferAttributes)
override def aggBufferSchema: StructType = DataTypeUtils.fromAttributes(aggBufferAttributes)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StructType.fromAttributes has been refactored into DataTypeUtils.fromAttributes
Reference: apache/spark@8ff6b7a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, it would be great if we could approve and merge this so that we could use it with V3.5


/** Allocate enough words to store all registers. */
override val aggBufferAttributes: Seq[AttributeReference] = Seq.tabulate(NUM_WORDS) { i =>
Expand Down