Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update data type alias #951

Merged
merged 3 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions docs/nightly/en/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,24 @@ INSERT INTO bools(b) VALUES (TRUE), (FALSE);

For users migrating from MySQL or PostgreSQL to GreptimeDB, GreptimeDB supports the following alias types.

| Data Type | Alias Types |
|----------------------|-------------------------------------------|
| `String` | `Text`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond`| `Timestamp`, `Timestamp_ms` , `Timestamp(3)`|
| `TimestampMicroSecond`| `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond`| `Timestamp_ns`, `Timestamp(9)` |
| Data Type | Alias Types |
| ---------------------- | --------------------------------------------------------------- |
| `String` | `Text`, `TinyText`, `MediumText`, `LongText`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond` | `Timestamp`, `Timestamp_ms`, `Timestamp(3)` |
| `TimestampMicroSecond` | `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond` | `Timestamp_ns`, `Timestamp(9)` |

You can use these alias types when creating tables.
For example, use `Varchar` instead of `String`, `Double` instead of `Float64`, and `Timestamp(0)` instead of `TimestampMillisecond`.
Expand Down
36 changes: 18 additions & 18 deletions docs/nightly/zh/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,24 @@ INSERT INTO bools(b) VALUES (TRUE), (FALSE);

对于从 MySQL 或 PostgreSQL 迁移到 GreptimeDB 的用户,GreptimeDB 支持以下类型别名。

| 数据类型 | 别名 |
|----------------------|----------------------------------------|
| `String` | `Text`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond`| `Timestamp`, `Timestamp_ms` , `Timestamp(3)`|
| `TimestampMicroSecond`| `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond`| `Timestamp_ns`, `Timestamp(9)` |
| 数据类型 | 别名 |
| ---------------------- | --------------------------------------------------------------- |
| `String` | `Text`, `TinyText`, `MediumText`, `LongText`, `Varchar`, `Char` |
| `Binary` | `Varbinary` |
| `Int8` | `TinyInt` |
| `Int16` | `SmallInt` |
| `Int32` | `Int` |
| `Int64` | `BigInt` |
| `UInt8` | `UnsignedInt` |
| `UInt16` | `UnsignedTinyInt` |
| `UInt32` | `UnsignedSmallInt` |
| `UInt64` | `UnsignedBigInt` |
| `Float32` | `Float` |
| `Float64` | `Double` |
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
| `TimestampMillisecond` | `Timestamp`, `Timestamp_ms` , `Timestamp(3)` |
| `TimestampMicroSecond` | `Timestamp_us`, `Timestamp(6)` |
| `TimestampNanosecond` | `Timestamp_ns`, `Timestamp(9)` |

在创建表时也可以使用这些别名类型。
例如,使用 `Varchar` 代替 `String`,使用 `Double` 代替 `Float64`,使用 `Timestamp(0)` 代替 `TimestampMillisecond`。
Expand Down
Loading