--- license: cc-by-4.0 task_categories: - tabular-classification - tabular-regression language: - en tags: - tsfile - timeseries - time-series - africa - electric-sheep-africa - open-data - metadata-backed - climate-environment - parquet - tabular - text - humanitarian - hdx - climate-weather - environment - cod - climate - weather - rainfall - format:tsfile pretty_name: 'Democratic Republic of the Congo: Rainfall Indicators at Subnational Level | Africa (original) (TsFile)' size_categories: - 100K **Read this dataset with the Java SDK.** It is written with the `zstd` compressor. The Apache TsFile Java SDK reads every compressor, but the Python SDK (`pip install tsfile`) implements only `UNCOMPRESSED`, `SNAPPY`, `GZIP` and `LZ4`; opening this file with it yields no rows. Read a converted file with the Apache TsFile Java SDK (`org.apache.tsfile:tsfile`): ```java import org.apache.tsfile.file.metadata.IDeviceID; import org.apache.tsfile.read.TsFileReader; import org.apache.tsfile.read.TsFileSequenceReader; import org.apache.tsfile.read.common.Path; import org.apache.tsfile.read.expression.QueryExpression; import org.apache.tsfile.read.query.dataset.QueryDataSet; import org.apache.tsfile.write.schema.MeasurementSchema; import java.util.ArrayList; import java.util.List; String path = "africa_cod_rainfall.tsfile"; try (TsFileSequenceReader sequenceReader = new TsFileSequenceReader(path); TsFileReader reader = new TsFileReader(sequenceReader)) { // Devices are enumerated as IDeviceID objects. Tables with TAG columns // have multi-segment device ids that cannot be rebuilt from their string // form, so always use getAllDevices() rather than getAllDeviceIds(). for (IDeviceID device : sequenceReader.getAllDevices()) { List paths = new ArrayList<>(); for (MeasurementSchema schema : reader.getMeasurement(device)) { String name = schema.getMeasurementName(); if (name != null && !name.isEmpty() && !name.equalsIgnoreCase("Time")) { paths.add(new Path(device, name, true)); } } QueryDataSet dataSet = reader.query(QueryExpression.create(paths, null)); while (dataSet.hasNext()) { System.out.println(dataSet.next()); } } } ``` ## Source & license - Original dataset: [`electricsheepafrica/africa-cod-rainfall-subnational`](https://huggingface.co/datasets/electricsheepafrica/africa-cod-rainfall-subnational) - Source card title: Democratic Republic of the Congo: Rainfall Indicators at Subnational Level | Africa (original) - License: cc-by-4.0 (as declared by the original dataset).