跳到正文
Skillpedia
分析与电子表格12k · #11557

rerun-parquet

它能做什么

该技能说明如何通过配置而不是自定义代码,把 Parquet 表格映射到 Rerun 数据模型上。适用于拥有存储在 Parquet 文件中的表格式机器人或传感器数据的人。

适用场景

  • ✓当你有一个包含机器人轨迹或传感器读数的 Parquet 文件,想加载到 Rerun 中时。
  • ✓当你需要决定哪些列成为时间线、实体或分组组件时。
  • ✓当有人建议先用 pandas 重塑 Parquet 文件,而你希望走更简单的路径时。

技能链接

https://github.com/rerun-io/rerun/blob/main/skills/rerun-parquet/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/rerun-io/rerun/blob/main/skills/rerun-parquet/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我有一个包含随时间变化的关节位置的 Parquet 文件。如何用正确的时间线把它加载到 Rerun 中?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会设置一个读取器,按列名前缀对列进行分组,并把时间列标记为时间线。然后,它添加 lens,把分组后的数值转换为带类型的 Rerun 组件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Rerun parquet ingestion

ParquetReader is a pure reader: it maps a flat table onto the Rerun model by turning raw columns into grouped, time-indexed chunks of struct and scalar components. Column-name prefixes become entities, grouped columns become a single struct component, designated columns become timelines. The reader does not assemble archetypes anymore — mapping struct fields into typed Rerun components (Transform3D, Scalars, Points3D) is done with lenses on the reader's .stream(). The whole reader job is configuration; fill in the rerun-data-model mapping table first, then express it through stream(). Stream mechanics after .stream() are in rerun-chunk-processing.

The whole table is configuration, not code. If you find yourself building Chunk.from_columns from a parquet, or munging it in pandas first, stop — ParquetReader plus a lens almost certainly expresses it. Anything the reader cannot express (per-row entity routing, derived values, unit conversion) belongs in lenses downstream, not in pre-pandas munging; keep the pipeline columnar.

The API

from rerun.chunk import DeriveLens, IndexColumn
from rerun.experimental import ParquetReader

reader = ParquetReader(table_path)  # a lightweight handle over the file
stream = reader.stream(
    entity_path_prefix="/world",  # prepended to every entity path
    column_grouping="prefix",  # "prefix" | "individual" | "explicit_prefixes"
    delimiter="_",  # split for column_grouping="prefix"
    prefixes=None,  # required for "explicit_prefixes"
    use_structs=True,  # pack grouped columns into one struct component
    static_columns=["robot_type"],  # constant-per-file values, logged static
    index_columns=[IndexColumn.timestamp("timestamp", input_unit="us"), IndexColumn.sequence("frame_index")],
)

The constructor takes only path; all loading options live on stream(), and every one is keyword-only. Each stream() call is independent, so one reader can drive several differently-configured streams over the same file. The config is validated against the file's schema at stream() (missing index/static columns raise ValueError there, not mid-iteration). There is no column_rules kwarg — typed-component assembly moved to lenses (below).

What the reader emits

The reader turns the table into chunks, one chunk per group, then leaves the data as generic struct/scalar components for lenses to map. The naming is the key thing the rest of the pipeline keys off:

  • A grouped multi-column prefix X → entity /X, with a single struct component named data. The struct's fields are the column names with the prefix (and delimiter, for "prefix") stripped. So A_pos_x, A_quat_w under prefix A land as struct data with fields pos_x, quat_w on entity /A.

  • A lone column with no group → its own entity named after the column, and a raw component named after the column — not a data struct. So a speed column becomes entity /speed, component speed.

  • A /__properties metadata chunk built from the parquet file's schema metadata. You typically drop it right after .stream():

    stream = reader.stream().drop(content="/__properties/**")
    

Column grouping: which columns share an entity

  • "prefix" (default): split each column name on delimiter, group by the first segment. gripper_pos_x, gripper_pos_y → entity /gripper, struct data{pos_x, pos_y}.
  • "explicit_prefixes": group by the exact strings in prefixes, tried longest-first; the prefix is stripped from each struct field name (a raw string match, no delimiter — foo + a → field a). Columns matching no prefix become individual groups. Use this when names contain the delimiter ambiguously (observation.state vs observation.images.top: pass the full prefixes).
  • "individual": every column is its own chunk/entity with a raw component named after the column — no struct packing at all, even for columns sharing a prefix. use_structs is ignored here. Rarely the model you want; reach for it only as a debugging baseline.

use_structs=True (default) packs a group's columns into a single Arrow struct component (the data field) for "prefix"/"explicit_prefixes"; False emits one component per column (the pre-struct flat layout, what queries see as separate columns).

Timelines: index_columns

Each entry is built with IndexColumn: `IndexColumn.timestamp(

常见问题

哪一列应该作为时间线?

该技能要求你把时间列或索引列标记为时间线,这样在查看录制时,所有数据都会与之对齐。

我需要编写 Python 代码吗?

该技能把映射视为配置。只有读取器无法表达的步骤才需要代码,这些步骤通过 lens 处理。

什么是 lens?

lens 是一个小规则,可把原始的分组列转换为带类型的 Rerun 组件,例如变换或一组标量值。

详情

作者的原始描述

Ingest tabular Parquet files into Rerun chunk streams with rerun.experimental.ParquetReader. Read when converting trajectory or sensor tables (LeRobot-style parquet, exported logs) into entities and components — column grouping, timeline/index columns, static columns, and lenses (DeriveLens) that assemble the typed components (Transform3D, Scalars) from the reader's grouped struct/scalar output. Builds on rerun-chunk-processing and rerun-data-model.

repo: rerun-io/rerun

热度

GitHub 星标
12k
排名
#11557
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能