Skip to content
Open
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: 3 additions & 1 deletion .github/workflows/build-sbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ jobs:
strategy:
fail-fast: false
matrix:
scala: [ 2.11.12, 2.12.15 ]
scala: [ 2.11.12, 2.12.15, 2.13.14 ]
spark: [ 2.4.8, 3.2.2 ]
exclude:
- scala: 2.11.12
spark: 3.2.2
- scala: 2.12.15
spark: 2.4.8
- scala: 2.13.14
spark: 2.4.8
name: SBT Spark ${{matrix.spark}} on Scala ${{matrix.scala}}
steps:
- name: Checkout code
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/jacoco_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
spark: 3.2.2
overall: 0.0
changed: 80.0
- scala: 2.13.14
scala_short: 2.13
spark: 3.2.2
overall: 0.0
changed: 80.0
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ For project using Scala 2.12
<version>ATUM_VERSION_HERE</version>
</dependency>
```
For project using Scala 2.13
```xml
<dependency>
<groupId>za.co.absa</groupId>
<artifactId>atum_2.13</artifactId>
<version>ATUM_VERSION_HERE</version>
</dependency>
```

### Initial info file generation example

Expand Down Expand Up @@ -305,7 +313,7 @@ Starting with version 3.3.0, there is also persistence support for AWS S3 via AW
```xml
<dependency>
<groupId>za.co.absa</groupId>
<artifactId>atum-s3-sdk-extension_2.11</artifactId> <!-- or 2.12 -->
<artifactId>atum-s3-sdk-extension_2.11</artifactId> <!-- or 2.12 / 2.13 -->
<version>${project.version}</version> <!-- e.g. 3.3.0 -->
</dependency>
```
Expand Down Expand Up @@ -361,13 +369,13 @@ with `3.5.3` and `3.7.0-M15`.
```xml
<dependency>
<groupId>org.json4s</groupId>
<artifactId>json4s-core_2.11</artifactId> <!-- or 2.12 -->
<artifactId>json4s-core_2.11</artifactId> <!-- or 2.12 / 2.13 -->
<version>${json4s.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json4s</groupId>
<artifactId>json4s-jackson_2.11</artifactId> <!-- or 2.12 -->
<artifactId>json4s-jackson_2.11</artifactId> <!-- or 2.12 / 2.13 -->
<version>${json4s.version}</version>
<scope>provided</scope>
</dependency>
Expand All @@ -377,7 +385,7 @@ Then, just include the model library
```xml
<dependency>
<groupId>za.co.absa</groupId>
<artifactId>atum-model_2.11</artifactId> <!-- or 2.12 -->
<artifactId>atum-model_2.11</artifactId> <!-- or 2.12 / 2.13 -->
<version>3.5.1</version>
</dependency>
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mock-maker-inline
org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ class BuildPropertiesSpec extends AnyFlatSpec {
}

"Project Name" should "start with atum and scala version" in {
assert(name.matches("""^atum_(2\.11|2\.12)$"""))
assert(name.matches("""^atum_(2\.11|2\.12|2\.13)$"""))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ControlMeasureBuilderTest extends AnyFlatSpec with ControlMeasureBaseTestS
// prior to stabilization, let's check the actual by-default generated software fields:
defaultCm.checkpoints.map(_.software).foreach { swName =>
swName shouldBe defined
swName.get should fullyMatch regex ("""^atum_(2\.11|2\.12)$""")
swName.get should fullyMatch regex ("""^atum_(2\.11|2\.12|2\.13)$""")
}

defaultCm.stabilizeTestingControlMeasure shouldBe expectedDefaultControlMeasure
Expand Down Expand Up @@ -101,7 +101,7 @@ class ControlMeasureBuilderTest extends AnyFlatSpec with ControlMeasureBaseTestS
// prior to stabilization, let's check the actual by-default generated software fields:
customCm.checkpoints.map(_.software).foreach { swName =>
swName shouldBe defined
swName.get should fullyMatch regex ("""^atum_(2\.11|2\.12)$""")
swName.get should fullyMatch regex ("""^atum_(2\.11|2\.12|2\.13)$""")
}

customCm.stabilizeTestingControlMeasure shouldBe expectedCustomControlMeasure
Expand Down
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import com.github.sbt.jacoco.report.JacocoReportSettings

lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.15"
lazy val scala213 = "2.13.14"

ThisBuild / scalaVersion := scala211 // default version
ThisBuild / crossScalaVersions := Seq(scala211, scala212)
ThisBuild / crossScalaVersions := Seq(scala211, scala212, scala213)

lazy val printSparkScalaVersion = taskKey[Unit]("Print Spark and Scala versions that Atum is being built for.")
ThisBuild / printSparkScalaVersion := {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ import org.apache.log4j.LogManager
import org.apache.spark.sql.{DataFrame, SaveMode}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.Eventually
import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.flatspec.{AnyFlatSpec, AsyncFlatSpec}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.specs2.matcher.Matchers.concurrentExecutionContext
import za.co.absa.atum.model.{Checkpoint, Measurement}
import za.co.absa.atum.persistence.ControlMeasuresParser
import za.co.absa.atum.utils.SparkTestBase
import za.co.absa.atum.AtumImplicits._

import scala.concurrent.duration.{Duration, DurationInt}
import scala.concurrent.{Await, Future}
import scala.concurrent.duration.DurationInt

class HdfsInfoIntegrationSuite extends AnyFlatSpec with SparkTestBase with Matchers with BeforeAndAfterAll with Eventually {

Expand Down
47 changes: 22 additions & 25 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ object Dependencies {
val jacksonDatabind_spark2 = "2.12.7.1" // databind has extra extra patch for this version - for Spark2
val jacksonDatabind_spark3 = jacksonModuleScala_spark3 // for Spark3 - latest version is ok

val absaCommons = "0.0.27"
val absaCommons = "2.0.4"
val typesafeConfig = "1.4.1"
val mockitoScala = "1.17.12"
val scalatest = "3.2.9"
val specs2 = "2.5"
val aws = "2.17.85"

val apacheCommonsLang3 = "3.12.0"
Expand All @@ -47,54 +46,55 @@ object Dependencies {
scalaVersion match {
case _ if scalaVersion.startsWith("2.11") => Versions.spark2
case _ if scalaVersion.startsWith("2.12") => Versions.spark3
case _ => throw new IllegalArgumentException("Only Scala 2.11 and 2.12 are currently supported.")
case _ if scalaVersion.startsWith("2.13") => Versions.spark3
case _ => throw new IllegalArgumentException("Only Scala 2.11, 2.12 and 2.13 are currently supported.")
}
}

// general wrapper to simplify s2.11/2.12 version assigning
// general wrapper to simplify s2.11/2.12/2.13 version assigning
def moduleByScala(moduleIdWithoutVersion: String => ModuleID)
(scala211Version: String, scala212Version: String)
(scala211Version: String, scala212Version: String, scala213Version: String)
(actualScalaVersion: String): ModuleID = {
actualScalaVersion match {
case _ if actualScalaVersion.startsWith("2.11") => moduleIdWithoutVersion.apply(scala211Version)
case _ if actualScalaVersion.startsWith("2.12") => moduleIdWithoutVersion.apply(scala212Version)
case _ => throw new IllegalArgumentException("Only Scala 2.11 and 2.12 are currently supported.")
case _ if actualScalaVersion.startsWith("2.11") => moduleIdWithoutVersion(scala211Version)
case _ if actualScalaVersion.startsWith("2.12") => moduleIdWithoutVersion(scala212Version)
case _ if actualScalaVersion.startsWith("2.13") => moduleIdWithoutVersion(scala213Version)
case _ => throw new IllegalArgumentException("Only Scala 2.11, 2.12 and 2.13 are currently supported.")
}
}


// extended version where to moduleId Fn takes 2 params: module version and scala version (to pass along)
def moduleByScalaUsingScalaVersion(moduleIdWithoutVersionNeedsScalaVersion: (String, String) => ModuleID)
(scala211Version: String, scala212Version: String)
(scala211Version: String, scala212Version: String, scala213Version: String)
(actualScalaVersion: String): ModuleID = {
actualScalaVersion match {
case _ if actualScalaVersion.startsWith("2.11") => moduleIdWithoutVersionNeedsScalaVersion.apply(scala211Version, actualScalaVersion)
case _ if actualScalaVersion.startsWith("2.12") => moduleIdWithoutVersionNeedsScalaVersion.apply(scala212Version, actualScalaVersion)
case _ => throw new IllegalArgumentException("Only Scala 2.11 and 2.12 are currently supported.")
case _ if actualScalaVersion.startsWith("2.11") => moduleIdWithoutVersionNeedsScalaVersion(scala211Version, actualScalaVersion)
case _ if actualScalaVersion.startsWith("2.12") => moduleIdWithoutVersionNeedsScalaVersion(scala212Version, actualScalaVersion)
case _ if actualScalaVersion.startsWith("2.13") => moduleIdWithoutVersionNeedsScalaVersion(scala213Version, actualScalaVersion)
case _ => throw new IllegalArgumentException("Only Scala 2.11, 2.12 and 2.13 are currently supported.")
}
}


lazy val sparkCore = {
def coreWithExcludes(version: String, scalaVersion: String): ModuleID = "org.apache.spark" %% "spark-core" % version % Provided exclude(
"com.fasterxml.jackson.core", "jackson-databind"
) exclude(
"com.fasterxml.jackson.module", "jackson-module-scala_" + scalaVersion.substring(0, 4) // e.g. 2.11
)
moduleByScalaUsingScalaVersion(coreWithExcludes)(Versions.spark2, Versions.spark3) _
moduleByScalaUsingScalaVersion(coreWithExcludes)(Versions.spark2, Versions.spark3, Versions.spark3) _
}

lazy val sparkSql = moduleByScala("org.apache.spark" %% "spark-sql" % _ % Provided)(Versions.spark2, Versions.spark3) _
lazy val sparkSql = moduleByScala("org.apache.spark" %% "spark-sql" % _ % Provided)(Versions.spark2, Versions.spark3, Versions.spark3) _

lazy val scalaTest = "org.scalatest" %% "scalatest" % Versions.scalatest % Test

lazy val json4sExt = moduleByScala("org.json4s" %% "json4s-ext" % _)(Versions.json4s_spark2, Versions.json4s_spark3) _
lazy val json4sCore = moduleByScala("org.json4s" %% "json4s-core" % _ % Provided)(Versions.json4s_spark2, Versions.json4s_spark3) _
lazy val json4sJackson = moduleByScala("org.json4s" %% "json4s-jackson" % _ % Provided)(Versions.json4s_spark2, Versions.json4s_spark3) _
lazy val json4sNative = moduleByScala("org.json4s" %% "json4s-native" % _ % Provided)(Versions.json4s_spark2, Versions.json4s_spark3) _
lazy val json4sExt = moduleByScala("org.json4s" %% "json4s-ext" % _)(Versions.json4s_spark2, Versions.json4s_spark3, Versions.json4s_spark3) _
lazy val json4sCore = moduleByScala("org.json4s" %% "json4s-core" % _ % Provided)(Versions.json4s_spark2, Versions.json4s_spark3, Versions.json4s_spark3) _
lazy val json4sJackson = moduleByScala("org.json4s" %% "json4s-jackson" % _ % Provided)(Versions.json4s_spark2, Versions.json4s_spark3, Versions.json4s_spark3) _
lazy val json4sNative = moduleByScala("org.json4s" %% "json4s-native" % _ % Provided)(Versions.json4s_spark2, Versions.json4s_spark3, Versions.json4s_spark3) _

lazy val jacksonModuleScala = moduleByScala("com.fasterxml.jackson.module" %% "jackson-module-scala" % _)(Versions.jacksonModuleScala_spark2, Versions.jacksonModuleScala_spark3) _
lazy val jacksonDatabind = moduleByScala("com.fasterxml.jackson.core" % "jackson-databind" % _)(Versions.jacksonDatabind_spark2, Versions.jacksonDatabind_spark3) _
lazy val jacksonModuleScala = moduleByScala("com.fasterxml.jackson.module" %% "jackson-module-scala" % _)(Versions.jacksonModuleScala_spark2, Versions.jacksonModuleScala_spark3, Versions.jacksonModuleScala_spark3) _
lazy val jacksonDatabind = moduleByScala("com.fasterxml.jackson.core" % "jackson-databind" % _)(Versions.jacksonDatabind_spark2, Versions.jacksonDatabind_spark3, Versions.jacksonDatabind_spark3) _

lazy val absaCommons = "za.co.absa.commons" %% "commons" % Versions.absaCommons
lazy val commonsConfiguration = "commons-configuration" % "commons-configuration" % Versions.commonsConfiguration
Expand All @@ -105,8 +105,6 @@ object Dependencies {
lazy val mockitoScalaScalatest = "org.mockito" %% "mockito-scala-scalatest" % Versions.mockitoScala % Test

lazy val scalaTestProvided = "org.scalatest" %% "scalatest" % Versions.scalatest % Provided
lazy val specs2core = "org.specs2" %% "specs2-core" % Versions.specs2 % Test

lazy val sdkS3 = "software.amazon.awssdk" % "s3" % Versions.aws

def rootDependencies(scalaVersion: String): Seq[ModuleID] = Seq(
Expand Down Expand Up @@ -135,7 +133,6 @@ object Dependencies {
)

lazy val examplesDependencies: Seq[ModuleID] = Seq(
specs2core,
scalaTestProvided
)

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
#

sbt.version = 1.5.5
sbt.version = 1.9.9
Loading