Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/jacoco_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
run: sbt jacoco
- name: Add coverage to PR for scala 2.11 and spark 2.4
id: jacoco211
uses: madrapps/jacoco-report@v1.3
uses: madrapps/jacoco-report@v1.7.2
with:
paths: ${{ github.workspace }}/spark-commons/target/spark2.4-jvm-2.11/jacoco/report/jacoco.xml
paths: ${{ github.workspace }}/spark-commons/spark2.4-jvm-2.11/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
Expand All @@ -49,9 +49,9 @@ jobs:
echo "Changed Files coverage ${{ steps.jacoco211.outputs.coverage-changed-files }}"
- name: Add coverage to PR for scala 2.12 and spark 3.3
id: jacoco212
uses: madrapps/jacoco-report@v1.3
uses: madrapps/jacoco-report@v1.7.2
with:
paths: ${{ github.workspace }}/spark-commons/target/spark3.3-jvm-2.12/jacoco/report/jacoco.xml
paths: ${{ github.workspace }}/spark-commons/spark3-jvm-2.12/jacoco/report/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 0.0
min-coverage-changed-files: 80.0
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
[![Build](https://github.com/AbsaOSS/spark-commons/actions/workflows/build.yml/badge.svg)](https://github.com/AbsaOSS/spark-commons/actions/workflows/build.yml)
[![Release](https://github.com/AbsaOSS/spark-commons/actions/workflows/release.yml/badge.svg)](https://github.com/AbsaOSS/spark-commons/actions/workflows/release.yml)

`spark-commons` is a library offering commonly needed routines, classes and functionality. It consists of three modules.
`spark-commons` is a library offering commonly needed routines, classes and functionality. It's build for Apache Spark of versions 2.4.x, 3.2.x, 3.3.x, 3.4.x and 3.5.x.
* spark-commons-spark2.4
* spark-commons-spark3.2
* spark-commons-spark3.3
* spark-commons-spark3.4
* spark-commons-spark3.5
* spark-commons-test

**spark2-commons** and **spark3-commons** both offer the same logic for the respective major versions of Spark addressing
usual needs of Spark applications.

**spark-commons-test** then brings routines to help in testing Spark applications (and it's independent of Spark
version used)
version used)


| | spark-commons-spark2.4 | spark-commons-spark3.2 | spark-commons-spark3.3 | spark-commons-test |
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| _Scala 2.11_ | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.11) | | | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.11) |
| _Scala 2.12_ | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.2_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.2_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.3_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.3_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.12) |
| | spark-commons-spark2.4 | spark-commons-spark3.2 | spark-commons-spark3.3 | spark-commons-spark3.4 | spark-commons-spark3.5 | spark-commons-test |
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| _Scala 2.11_ | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.11) | | | | | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.11) |
| _Scala 2.12_ | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark2.4_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.2_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.2_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.3_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.3_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.4_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.4_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.5_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.5_2.12) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.12) |
| _Scala 2.13_ | | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.2_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.2_2.13) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.3_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.3_2.13) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.4_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.4_2.13) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.5_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-spark3.5_2.13) | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/za.co.absa/spark-commons-test_2.13) |

## Spark-Commons

Expand Down
31 changes: 25 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.18"
lazy val scala213 = "2.13.13"
lazy val spark2 = "2.4.8"
lazy val spark32 = "3.2.4"
lazy val spark33 = "3.3.2"
lazy val spark32 = "3.2.4"
lazy val spark33 = "3.3.2"
lazy val spark34 = "3.4.4"
lazy val spark35 = "3.5.5"
Copy link
Collaborator

Choose a reason for hiding this comment

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

still, don't we want to build it also for Spark 3.4 ? Since it's OSS used across many projects

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it's necessary. And by that logic I would have to add few additional versions (both lower and higher).

Copy link
Collaborator

Choose a reason for hiding this comment

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

so what happens if someone is using Spark 3.4 in their project? What would happen if we are using it on some of our major projects? Isn't it the same scenario as for this 3.5.x?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's been added, hope it's alright finally


import Dependencies._
import SparkVersionAxis._
Expand All @@ -47,24 +49,41 @@ lazy val commonJacocoExcludes: Seq[String] = Seq(
)

lazy val parent = (project in file("."))
.aggregate(sparkCommons.projectRefs ++ sparkCommonsTest.projectRefs: _*)
.aggregate(
sparkCommonsSpark2.projectRefs ++
sparkCommonsSpark3.projectRefs ++
sparkCommonsTest.projectRefs: _*
)
.settings(
name := "spark-commons-parent",
publish / skip := true
)

lazy val `sparkCommons` = (projectMatrix in file("spark-commons"))
lazy val sparkCommonsSpark2 = (projectMatrix in file("scala-spark2.4-jvm"))
.settings(commonSettings: _*)
.sparkRow(SparkVersionAxis(spark2), scalaVersions = Seq(scala211, scala212))
.settings(
Compile / unmanagedSourceDirectories := Seq((Compile / sourceDirectory).value / "main" / "scala")
)

lazy val spark3Versions = Seq(spark32, spark33, spark34, spark35)
lazy val sparkCommonsSpark3 = (projectMatrix in file("scala-spark3-jvm"))
.settings(commonSettings: _*)
.sparkRow(SparkVersionAxis(spark32), scalaVersions = Seq(scala212, scala213))
.sparkRow(SparkVersionAxis(spark33), scalaVersions = Seq(scala212, scala213))
.dependsOn(sparkCommonsTest % "test")
.sparkRow(SparkVersionAxis(spark34), scalaVersions = Seq(scala212, scala213))
.sparkRow(SparkVersionAxis(spark35), scalaVersions = Seq(scala212, scala213))
.settings(
Compile / unmanagedSourceDirectories := Seq((Compile / sourceDirectory).value / "main" / "scala")
)

lazy val sparkCommonsTest = (projectMatrix in file("spark-commons-test"))
.settings(
commonSettings ++ Seq(
name := "spark-commons-test",
libraryDependencies ++= sparkDependencies(if (scalaVersion.value == scala211) spark2 else spark32),
libraryDependencies ++= sparkDependencies(
if (scalaVersion.value == scala211) spark2 else spark35
),
Compile / unmanagedSourceDirectories += {
val sourceDir = (Compile / sourceDirectory).value
if (scalaVersion.value.startsWith("2.13")) {
Expand Down
4 changes: 3 additions & 1 deletion project/SparkVersionAxis.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ object SparkVersionAxis {
scalaVersions = Seq(scalaVersion),
axisValues = Seq(sparkAxis, VirtualAxis.jvm),
_.settings(
moduleName := camelCaseToLowerDashCase(name.value + sparkAxis.directorySuffix),
moduleName := camelCaseToLowerDashCase(
name.value.replaceAll("(Spark2|Spark3)$", "") + sparkAxis.directorySuffix
),
libraryDependencies ++= sparkCommonsDependencies(sparkAxis.sparkVersion),
jacocoReportSettings := jacocoSettings(sparkVersion, scalaVersion),
jacocoExcludes := jacocoProjectExcludes(sparkVersion, scalaVersion)
Expand Down
6 changes: 6 additions & 0 deletions publish.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ ThisBuild / developers := List(
name = "Ladislav Sulak",
email = "[email protected]",
url = url("https://github.com/lsulak")
),
Developer(
id = "salamonpavel",
name = "Pavel Salamon",
email = "[email protected]",
url = url("https://github.com/salamonpavel")
)
)

Expand Down

This file was deleted.

This file was deleted.