If an aggregated HDFS table is created with an incorrect schema or data (for example, due to pointing a Spark job at the wrong input directory), remove it and regenerate:
hdfs dfs -rm -r /ghcnd/agg_tables/yearly_aggregates
spark-submit scripts/agg_tables/agg_table_yearly_aggregates.py
Apply the same pattern for other tables under /ghcnd/agg_tables/ as needed.
The API uses a long-lived SparkSession running under a systemd service. If /tmp is cleaned aggressively, Spark may experience missing block manager directories (errors mentioning /tmp/blockmgr-...).
In such cases, restart the service to create new temporary directories:
sudo systemctl restart ghcnd-api
When no data is found for a requested combination of country_prefix, start_year, and end_year, some endpoints return null values rather than failing:
nullnull date or valueClient code should be written to handle null values explicitly.
Use standard systemd and journal commands:
sudo systemctl status ghcnd-api
journalctl -u ghcnd-api -f
Monitor:
The repository includes several additional shell and Python helpers:
scripts/run_spark.sh: Wrapper for spark-submit that standardises Spark memory, temporary directories, Hadoop configuration, and logging. Use this for all aggregation jobs under scripts/agg_tables/.scripts/exploratory_data_analysis.sh: Convenience script for running exploratory Spark analysis over the GHCND data.scripts/spark_jobs.py: Python module that can be extended to orchestrate or batch multiple Spark jobs.deploy.sh / local_deploy.sh: Deployment helpers that fetch the latest code for a given branch and restart the ghcnd-api systemd service (remote and local variants respectively).