RBR-OS
[G]ITHUB v2026.10 · APACHE-2.0

RBENREJEB@RBR-OS:/OPT/NETCDF-SPARK-PARSER$ CAT README

v1.0.0 · APACHE-2.0

NetCDF Spark Parser

A Spark DataSource V2 connector that reads NetCDF scientific files as DataFrames, at scale.

  • kind Spark connector
  • version v1.0.0
  • license Apache-2.0
  • language Scala
  • runs on Any (JVM, Apache Spark 3.5)

#scala#spark#netcdf#s3

Source on GitHub Docs

INSTALL

SBT · MAVEN CENTRAL
  1. Add "io.github.rejeb" %% "netcdf-spark-parser" % "1.0.0" to libraryDependencies in build.sbt.
  2. Read a file with spark.read.format("netcdf"), a schema and the path option.

Requires Java 11+, Apache Spark 3.5.x and Scala 2.12 or 2.13.

Installation guide

LATEST RELEASE

v1.0.02025-07-06> RELEASE NOTES

README

/OPT/NETCDF-SPARK-PARSER/README

Overview

A Spark connector for reading NetCDF files at scale. It uses the DataSource V2 API and NetCDF Java to turn multi-dimensional scientific data into tabular DataFrames.

Features

  • Custom schema support for NetCDF variables.
  • Automatic partitioning of large NetCDF files.
  • Distributed reads optimized for Spark.
  • Storage: local file systems and Amazon S3.

Read a file

val schema = StructType(Seq(
  StructField("temperature", FloatType),
  StructField("humidity", FloatType),
  StructField("timestamp", StringType)
))

val df = spark.read.format("netcdf")
  .schema(schema)
  .option("path", "/path/to/your/netcdf-file.nc")
  .load()
Option Description Default
path Path to the NetCDF file required
partition.size Rows per partition 20,000
dimensions.to.ignore Comma-separated dimensions to ignore none