wangdx25 commited on
Commit
38aa03c
·
verified ·
1 Parent(s): ef9c76f

Add TsFile (converted from harshithvaranasi/floodstack_test)

Browse files
.gitattributes CHANGED
@@ -58,3 +58,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ floodstack_test_g0.tsfile filter=lfs diff=lfs merge=lfs -text
62
+ floodstack_test_g1.tsfile filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - tsfile
4
+ - timeseries
5
+ - time-series
6
+ - format:tsfile
7
+ pretty_name: floodstack_test (TsFile)
8
+ configs:
9
+ - config_name: default
10
+ data_files:
11
+ - split: train
12
+ path: floodstack_test_g0.tsfile
13
+ - split: train
14
+ path: floodstack_test_g1.tsfile
15
+ ---
16
+
17
+ # floodstack_test (TsFile)
18
+
19
+ Apache TsFile version of [`harshithvaranasi/floodstack_test`](https://huggingface.co/datasets/harshithvaranasi/floodstack_test).
20
+
21
+ ## Overview
22
+
23
+ - **Tables:** 2 TsFile table(s), 255,650 rows in total.
24
+ - `floodstack_test_g0`: 36,500 rows, 2022-01-01 00:00:00 鈫?2023-12-31 00:00:00.049000 (UTC)
25
+ - `floodstack_test_g1`: 219,150 rows, 2010-01-01 00:00:00 鈫?2021-12-31 00:00:00.049000 (UTC)
26
+
27
+ ## Schema (TsFile structure)
28
+
29
+ ### `floodstack_test_g0.tsfile`
30
+
31
+ - **Time** (INT64, milliseconds) 鈥?the source `date` column.
32
+ - **TAG**: none 鈥?the table is stored as a single device.
33
+ - **FIELD** (9): `station_id` (int64), `precipitation_mm` (double), `temp_max_c` (double), `temp_min_c` (double), `soil_moisture` (double), `drainage_area_sqmi` (double), `mean_elevation_ft` (double), `slope_pct` (double), `forest_cover_pct` (double)
34
+
35
+ ### `floodstack_test_g1.tsfile`
36
+
37
+ - **Time** (INT64, milliseconds) 鈥?the source `date` column.
38
+ - **TAG**: none 鈥?the table is stored as a single device.
39
+ - **FIELD** (10): `station_id` (int64), `precipitation_mm` (double), `temp_max_c` (double), `temp_min_c` (double), `soil_moisture` (double), `drainage_area_sqmi` (double), `mean_elevation_ft` (double), `slope_pct` (double), `forest_cover_pct` (double), `discharge_cfs` (double)
40
+
41
+ ## Conversion notes
42
+
43
+ - One TsFile per source table (2 tables). Tables whose source carries several entities per file are stored as one device per entity.
44
+ - Time = the table's own clock column as INT64 milliseconds. The clock columns used here are `date`.
45
+ - No column is dropped. Rows that share a timestamp inside one device are ordered by a 1 ms step in stable source order, so calendar columns keep their exact day.
46
+
47
+ ## Usage
48
+
49
+ > **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.
50
+
51
+ Read a converted file with the Apache TsFile Java SDK (`org.apache.tsfile:tsfile`):
52
+
53
+ ```java
54
+ import org.apache.tsfile.file.metadata.IDeviceID;
55
+ import org.apache.tsfile.read.TsFileReader;
56
+ import org.apache.tsfile.read.TsFileSequenceReader;
57
+ import org.apache.tsfile.read.common.Path;
58
+ import org.apache.tsfile.read.expression.QueryExpression;
59
+ import org.apache.tsfile.read.query.dataset.QueryDataSet;
60
+ import org.apache.tsfile.write.schema.MeasurementSchema;
61
+
62
+ import java.util.ArrayList;
63
+ import java.util.List;
64
+
65
+ String path = "floodstack_test_g0.tsfile";
66
+ try (TsFileSequenceReader sequenceReader = new TsFileSequenceReader(path);
67
+ TsFileReader reader = new TsFileReader(sequenceReader)) {
68
+ // Devices are enumerated as IDeviceID objects. Tables with TAG columns
69
+ // have multi-segment device ids that cannot be rebuilt from their string
70
+ // form, so always use getAllDevices() rather than getAllDeviceIds().
71
+ for (IDeviceID device : sequenceReader.getAllDevices()) {
72
+ List<Path> paths = new ArrayList<>();
73
+ for (MeasurementSchema schema : reader.getMeasurement(device)) {
74
+ String name = schema.getMeasurementName();
75
+ if (name != null && !name.isEmpty() && !name.equalsIgnoreCase("Time")) {
76
+ paths.add(new Path(device, name, true));
77
+ }
78
+ }
79
+ QueryDataSet dataSet = reader.query(QueryExpression.create(paths, null));
80
+ while (dataSet.hasNext()) {
81
+ System.out.println(dataSet.next());
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ ## Source & license
88
+
89
+ - Original dataset: [`harshithvaranasi/floodstack_test`](https://huggingface.co/datasets/harshithvaranasi/floodstack_test)
90
+ - License: not declared (as declared by the original dataset).
floodstack_test_g0.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8eae828065ce8912d0bf1d6fee7d1d38524f3783d5a198f688bccf0a0d817e0
3
+ size 574124
floodstack_test_g1.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d6489f67a5930e1c0708cd8514d6f3092531f49fd7d5967a12d456d850de97f
3
+ size 4064333