Skip to content

Commit 667fce0

Browse files
Copilotkillme2008
andcommitted
Update Chinese documentation for numeric type aliases
- Add Int2, Int4, Int8, Float4, Float8 aliases to Chinese docs - Add warning callout in Chinese explaining breaking changes - Mirror changes from English version to maintain consistency Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
1 parent 03427d9 commit 667fce0

File tree

1 file changed

+18
-5
lines changed
  • i18n/zh/docusaurus-plugin-content-docs/current/reference/sql

1 file changed

+18
-5
lines changed

i18n/zh/docusaurus-plugin-content-docs/current/reference/sql/data-types.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,20 +308,33 @@ INSERT INTO bools(b) VALUES (TRUE), (FALSE);
308308
| `String` | `Text`, `TinyText`, `MediumText`, `LongText`, `Varchar`, `Char` |
309309
| `Binary` | `Varbinary` |
310310
| `Int8` | `TinyInt` |
311-
| `Int16` | `SmallInt` |
312-
| `Int32` | `Int` |
313-
| `Int64` | `BigInt` |
311+
| `Int16` | `SmallInt`, `Int2` |
312+
| `Int32` | `Int`, `Int4` |
313+
| `Int64` | `BigInt`, `Int8` |
314314
| `UInt8` | `UnsignedTinyInt` |
315315
| `UInt16` | `UnsignedSmallInt` |
316316
| `UInt32` | `UnsignedInt` |
317317
| `UInt64` | `UnsignedBigInt` |
318-
| `Float32` | `Float` |
319-
| `Float64` | `Double` |
318+
| `Float32` | `Float`, `Float4` |
319+
| `Float64` | `Double`, `Float8` |
320320
| `TimestampSecond` | `Timestamp_s`, `Timestamp_sec`, `Timestamp(0)` |
321321
| `TimestampMillisecond` | `Timestamp`, `Timestamp_ms` , `Timestamp(3)` |
322322
| `TimestampMicroSecond` | `Timestamp_us`, `Timestamp(6)` |
323323
| `TimestampNanosecond` | `Timestamp_ns`, `Timestamp(9)` |
324324

325+
:::warning 破坏性变更
326+
类型别名 `Int2``Int4``Int8``Float4``Float8` 遵循 PostgreSQL 和 MySQL 的约定,这些标识符表示类型中的**字节**数(而非位数)。
327+
328+
具体来说:
329+
- `Int2` = 2 字节 = `SmallInt`(16 位)
330+
- `Int4` = 4 字节 = `Int`(32 位)
331+
- `Int8` = 8 字节 = `BigInt`(64 位)- **破坏性变更**:之前映射到 `TinyInt`(8 位)
332+
- `Float4` = 4 字节 = `Float`(32 位)
333+
- `Float8` = 8 字节 = `Double`(64 位)
334+
335+
注意:GreptimeDB 的原生类型 `Int8`(8 位整数)与 SQL 别名 `INT8`(映射到 64 位 `BigInt`)不同。
336+
:::
337+
325338
在创建表时也可以使用这些别名类型。
326339
例如,使用 `Varchar` 代替 `String`,使用 `Double` 代替 `Float64`,使用 `Timestamp(0)` 代替 `TimestampSecond`
327340

0 commit comments

Comments
 (0)