Minimal multi-module SBT template for Scala 2.12 / 2.13 with:
coremodule for platform-agnostic codesparkmodule for Apache Spark (sql/core),providedscope- Publish-ready to Maven Central via sbt-ci-release
- GitHub Actions workflows (test + release)
- IntelliJ-friendly (import as SBT project)
- Scalafmt + recommended compiler flags
sbt +test
sbt +publishLocal- Open IntelliJ IDEA → New / Open → select this folder.
- Ensure Scala plugin is installed; use sbt shell for builds.
This project uses sbt-ci-release. Configure the following GitHub Secrets on your repo:
PGP_PASSPHRASE(optional, if your key is passphrase-protected)PGP_SECRET(ASCII-armored private key)SONATYPE_USERNAMESONATYPE_PASSWORD
On pushing a tag like v0.1.0, the CI pipeline will publish:
*-SNAPSHOTto snapshots on pushes to default branch- tagged releases to Sonatype (then Central)
Group is pre-set to io.github.platob. Update organization if needed.
import io.github.platob.arrow4s.core.ArrowArray
// Raw build
val values: Seq[Int] = Seq(1, 2, 3, 4, 5)
val array = ArrowArray(values:_*)
array == values
array.as[Option[Double]] == values.map(v => Option(v.toDouble))import io.github.platob.arrow4s.core.ArrowArray
case class TestRecord(a: Int, b: String, c: Option[Double], map: Map[String, Int])
val records = (1 to 5).map(i => TestRecord(
i, s"str_$i", if (i % 2 == 0) Some(i.toDouble) else None,
map = Map("key1" -> i, "key2" -> (i * 10))
))
val array = ArrowArray(records:_*)
val allColumns = array.as[(Int, String, Option[Double], Map[String, Int])]
val select = array.as[(Int, String, Option[Double])]
array == recordsimport io.github.platob.arrow4s.io.ipc.IPCInput
import io.github.platob.arrow4s.core.arrays.nested.ArrowRecord
val batches = ipc.batches[(Int, Double)].toList
val batch = batches.head
val record = batch(0)
assertEquals(batch.length, 5)
assertEquals(record._1, 1)