wangdx25 commited on
Commit
ea431fa
·
verified ·
1 Parent(s): 03a726b

Add TsFile (converted from harshithvaranasi/floodstack_train)

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_train_g0.tsfile filter=lfs diff=lfs merge=lfs -text
62
+ floodstack_train_g1.tsfile filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - tsfile
4
+ - timeseries
5
+ - format:tsfile
6
+ - time-series
7
+ configs:
8
+ - config_name: default
9
+ data_files:
10
+ - split: train
11
+ path: floodstack_train_g0.tsfile
12
+ - split: train
13
+ path: floodstack_train_g1.tsfile
14
+ ---
15
+
16
+ # floodstack_train
17
+
18
+ Converted from the Hugging Face dataset [`harshithvaranasi/floodstack_train`](https://huggingface.co/datasets/harshithvaranasi/floodstack_train) to Apache TsFile format.
19
+
20
+ ## Source Dataset
21
+
22
+ - **Original dataset:** [`harshithvaranasi/floodstack_train`](https://huggingface.co/datasets/harshithvaranasi/floodstack_train)
23
+
24
+ ## Conversion Notes
25
+
26
+ - Conversion mode: `script`
27
+ - Time precision: `ms`
28
+ - TsFile data files: `['floodstack_train_g0.tsfile', 'floodstack_train_g1.tsfile']`
29
+ - Converter: `scripts/converters/multi_table_scalar.py`
30
+
31
+ ## Usage
32
+
33
+ > **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.
34
+
35
+ Read a converted file with the Apache TsFile Java SDK (`org.apache.tsfile:tsfile`):
36
+
37
+ ```java
38
+ import org.apache.tsfile.file.metadata.IDeviceID;
39
+ import org.apache.tsfile.read.TsFileReader;
40
+ import org.apache.tsfile.read.TsFileSequenceReader;
41
+ import org.apache.tsfile.read.common.Path;
42
+ import org.apache.tsfile.read.expression.QueryExpression;
43
+ import org.apache.tsfile.read.query.dataset.QueryDataSet;
44
+ import org.apache.tsfile.write.schema.MeasurementSchema;
45
+
46
+ import java.util.ArrayList;
47
+ import java.util.List;
48
+
49
+ String path = "floodstack_train_g0.tsfile";
50
+ try (TsFileSequenceReader sequenceReader = new TsFileSequenceReader(path);
51
+ TsFileReader reader = new TsFileReader(sequenceReader)) {
52
+ // Devices are enumerated as IDeviceID objects. Tables with TAG columns
53
+ // have multi-segment device ids that cannot be rebuilt from their string
54
+ // form, so always use getAllDevices() rather than getAllDeviceIds().
55
+ for (IDeviceID device : sequenceReader.getAllDevices()) {
56
+ List<Path> paths = new ArrayList<>();
57
+ for (MeasurementSchema schema : reader.getMeasurement(device)) {
58
+ String name = schema.getMeasurementName();
59
+ if (name != null && !name.isEmpty() && !name.equalsIgnoreCase("Time")) {
60
+ paths.add(new Path(device, name, true));
61
+ }
62
+ }
63
+ QueryDataSet dataSet = reader.query(QueryExpression.create(paths, null));
64
+ while (dataSet.hasNext()) {
65
+ System.out.println(dataSet.next());
66
+ }
67
+ }
68
+ }
69
+ ```
floodstack_train_g0.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23251f186585a6f5af49e68cb351ad801bba1795802ee34707dcb8b5dc62aacb
3
+ size 574128
floodstack_train_g1.tsfile ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6192466a38ea5a24404998ed0f149d4cbe844dffc02e7da23f44130db226fad1
3
+ size 4064337