RBENREJEB@RBR-OS:/OPT/NETCDF-SPARK-PARSER$ CAT README
v1.0.0 · APACHE-2.0NetCDF Spark Parser
A Spark DataSource V2 connector that reads NetCDF scientific files as DataFrames, at scale.
INSTALL
SBT · MAVEN CENTRAL- Add
"io.github.rejeb" %% "netcdf-spark-parser" % "1.0.0"tolibraryDependenciesinbuild.sbt. - Read a file with
spark.read.format("netcdf"), a schema and thepathoption.
Requires Java 11+, Apache Spark 3.5.x and Scala 2.12 or 2.13.
LATEST RELEASE
v1.0.02025-07-06> RELEASE NOTES
README
/OPT/NETCDF-SPARK-PARSER/READMEOverview
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 |