Skip to content

Commit

Permalink
the merge_mode option in data model
Browse files Browse the repository at this point in the history
  • Loading branch information
nicecui committed Sep 5, 2024
1 parent ab2b50f commit f8634aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/user-guide/ingest-data/for-iot/influxdb-line-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ While you may already be familiar with [InfluxDB key concepts](https://docs.infl
Here are the similarities and differences between the data models of GreptimeDB and InfluxDB:

- Both solutions are [schemaless](/user-guide/ingest-data/overview.md#automatic-schema-generation), eliminating the need to define a schema before writing data.
- The GreptimeDB table is automatically created with the [`merge_mode` option](/reference/sql/create.md#create-a-table-with-merge-mode) set to `last_non_null`.
That means the table merges rows with the same tags and timestamp by keeping the latest value of each field, which is the same behavior as InfluxDB.
- In InfluxDB, a point represents a single data record with a measurement, tag set, field set, and a timestamp.
In GreptimeDB, it is represented as a row of data in the time-series table,
where the table name aligns with the measurement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ GreptimeDB 的[数据模型](/user-guide/concepts/data-model.md) 是值得了解
下方解释了 GreptimeDB 和 InfluxDB 数据模型的相似和不同之处:

- 两者都是 [schemaless 写入](/user-guide/ingest-data/overview.md#自动生成表结构)的解决方案,这意味着在写入数据之前无需定义表结构。
- GreptimeDB 的表在自动创建时会设置表选项 [`merge_mode`](/reference/sql/create.md#创建带有-merge-模式的表)`last_non_null`
这意味着表会通过保留每个字段的最新值来合并具有相同主键和时间戳的行,该行为与 InfluxDB 相同。
- 在 InfluxDB 中,一个点代表一条数据记录,包含一个 measurement、tag 集、field 集和时间戳。
在 GreptimeDB 中,它被表示为时间序列表中的一行数据。
表名对应于 measurement,列由三种类型组成:Tag、Field 和 Timestamp。
Expand Down

0 comments on commit f8634aa

Please sign in to comment.