Tsfile doc#846
Open
ColinLeeo wants to merge 1 commit into
Open
Conversation
64c87b2 to
97d4ad6
Compare
jt2594838
reviewed
Jun 18, 2026
| "weather.Beijing.temperature", | ||
| "weather.Beijing.humidity", | ||
| ]] | ||
| data.values # -> np.ndarray, shape = (N, 2) |
Contributor
There was a problem hiding this comment.
What is the N and the 2.
| | `df.list_timeseries("weather")` | Series names, optionally filtered by prefix | `List[str]` | | ||
| | `df["weather.Beijing.humidity"]`, `df[0]`, `df[-1]` | One series | `Timeseries` | | ||
| | `df["city"]` | A metadata column (a tag / `field` / `start_time` / `end_time` / `count`) | `pandas.Series` | | ||
| | `df[0:3]`, `df[[0, 2, 5]]` | A subset view | `TsFileDataFrame` | |
Contributor
There was a problem hiding this comment.
What does the index indicate/ what is the order of it.
| | `ts.name` | Series name | `str` | | ||
| | `len(ts)` | Number of points | `int` | | ||
| | `ts.stats` | Series statistics | `dict` (`start_time`, `end_time`, `count`) | | ||
| | `ts[20]` | Single value | `float` (or `None` if null) | |
Contributor
There was a problem hiding this comment.
It should be highlighted that only numeric values are supported.
How are non-numeric series processed? Silently skipped during construction or thrown an exception when visited?
Comment on lines
+97
to
+99
| | `data.values` | Value matrix | `np.ndarray`, shape `(N, M)` | | ||
| | `data.series_names` | Series names | `List[str]` | | ||
| | `data.shape` | Shape `(N, M)` — N timestamps, M series | `tuple` | |
Contributor
There was a problem hiding this comment.
May put shape first since it explains what N and M are.
Comment on lines
+106
to
+108
| A series is uniquely identified by its **series name**, a string formed by | ||
| joining the **table name**, the **tag-column values**, and the **field name** | ||
| with `.`, in that order: |
Contributor
There was a problem hiding this comment.
Highlight what will happen if . is contained in either of them.
| | `df[0:3]`、`df[[0, 2, 5]]` | 获取子集视图 | `TsFileDataFrame` | | ||
| | `df[df["city"] == "Beijing"]` | 按元数据列过滤 | `TsFileDataFrame` | | ||
| | `df.loc[start:end, series_list]` | 按时间戳对齐查询 | `AlignedTimeseries` | | ||
| | `df.show(max_rows=20)` / `print(df)` | 格式化元数据表格 | — | |
|
|
||
| ## 加载 | ||
|
|
||
| 路径可以是单个文件、文件列表或目录: |
Comment on lines
+143
to
+151
| 对于标签数量不同的设备:标签值按左对齐,较短的在末尾补 `None`。 | ||
|
|
||
| ```text | ||
| TsFileDataFrame(table model, 972 time series, 5 files) | ||
| table ps_id sn frac field start_time end_time count | ||
| 0 pvf 10 30100194A00234H00572 1 pac 2024-04-02 00:00:00 2024-10-28 23:45:00 20160 | ||
| 1 pvf 10 30100194A00234H00572 1 tenmeterswindspeed 2024-04-02 00:00:00 2024-10-28 23:45:00 20160 | ||
| ... | ||
| ``` |
Contributor
There was a problem hiding this comment.
什么是左对齐?
简单说缺失部分补 None 就行。
需要说明多个表的 tag 顺序不同时,如何处理等。
|
|
||
| ## 数据类型、编码与压缩 | ||
|
|
||
| 下列枚举为读写接口共用。其数值编码同时也是磁盘上存储的取值。 |
Contributor
There was a problem hiding this comment.
这个文档太简略了,截止到启动后面就没有了,然而后面的怎么用才是最重要的。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.