Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 21, 2025

Revert the type alias table column's order:

Screenshot 2025-11-22 at 05 57 42

Add some notes and warnings.

  • Review PR #7270 to understand the changes to numeric type aliases
  • Update the type alias table in docs/reference/sql/data-types.md to reflect the new mappings
  • Add new aliases: INT2, INT4, INT8, FLOAT4, FLOAT8
  • Build the documentation to ensure no errors
  • Add comprehensive warning about breaking changes
  • Fix formatting issues
  • Run final code review - passed with no comments
  • Run security checks - no code analysis needed for docs-only change
  • Update Chinese documentation with same changes
  • Improve Chinese translation clarity
  • Clarify bit vs byte naming convention distinction

Summary

Successfully updated both English and Chinese documentation to reflect the new numeric type aliases introduced in greptimedb PR #7270. Documentation now clearly explains the distinction between GreptimeDB's bit-based native type names and the byte-based SQL aliases.

Final Changes:

English Documentation (docs/reference/sql/data-types.md):

  • Added Int2, Int4, Int8, Float4, Float8 aliases
  • Added comprehensive warning about breaking changes
  • Clarified that native types use bits (Int8=8-bit) while SQL aliases use bytes (INT8=8-byte) following PostgreSQL/MySQL conventions

Chinese Documentation (i18n/zh/docusaurus-plugin-content-docs/current/reference/sql/data-types.md):

  • Added same type aliases in Chinese
  • Added Chinese translation with improved clarity about bit vs byte naming conventions
  • Maintained consistency with English version
Original prompt

This section details on the original issue you should resolve

<issue_title>Update docs for fix!: align numeric type aliases with PostgreSQL and MySQL</issue_title>
<issue_description>A document change request is generated from GreptimeTeam/greptimedb#7270</issue_description>

<agent_instructions>The file is at https://docs.greptime.com/reference/sql/data-types/#type-aliases

Updated alias table to reflect the updateds from DB PR

</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Add INT2 as alias for Int16 (SMALLINT)
- Add INT4 as alias for Int32 (INT)
- Add INT8 as alias for Int64 (BIGINT)
- Add FLOAT4 as alias for Float32 (FLOAT)
- Add FLOAT8 as alias for Float64 (DOUBLE)

This aligns with the changes from PR #7270 in greptimedb repository.

Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 21, 2025

Deploying greptime-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: cebf256
Status: ✅  Deploy successful!
Preview URL: https://11fbdfe6.greptime-docs.pages.dev
Branch Preview URL: https://copilot-update-numeric-type.greptime-docs.pages.dev

View logs

@killme2008
Copy link
Contributor

@copilot Need to update the chinese version too. And add some descriptions for these special alias to work with PG/MySQL, may be a new column in table? I am not sure.

Copilot AI and others added 3 commits November 21, 2025 19:43
Add a warning callout to document the breaking change where INT8 now maps to BigInt (64-bit) instead of TinyInt (8-bit) to align with PostgreSQL and MySQL conventions.

Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
- Clarify that Int2, Int4, Int8, Float4, Float8 refer to bytes not bits
- Add all new aliases to the warning (including Float4 and Float8)
- Explain the difference between native type Int8 and SQL alias INT8
- List specific mappings for all new aliases

Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
Copilot AI changed the title [WIP] Update docs for numeric type aliases alignment Update docs for numeric type aliases aligned with PostgreSQL and MySQL Nov 21, 2025
Copilot AI requested a review from killme2008 November 21, 2025 19:49
Copilot finished work on behalf of killme2008 November 21, 2025 19:49
@killme2008
Copy link
Contributor

@copilot I said you must also update the corresponding Chinese document.

- 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>
Copy link
Contributor Author

Copilot AI commented Nov 21, 2025

@copilot I said you must also update the corresponding Chinese document.

Chinese documentation has been updated in commit 667fce0 with the same type aliases and warning as the English version.

@copilot Need to update the chinese version too. And add some descriptions for these special alias to work with PG/MySQL, may be a new column in table? I am not sure.

Updated the Chinese documentation in commit 667fce0. The type alias table and breaking change warning are now consistent between English and Chinese versions.

@killme2008
Copy link
Contributor

killme2008 commented Nov 21, 2025

@copilot
Good, but right now Int8 in GreptimeDB native is bigint too. But like UInt8, INT32, INT64 is still in bits.

Specify that Int8 is a signed integer type in Chinese docs for better clarity

Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
Updated note to explain that GreptimeDB native type names (UInt8, Int32, Int64) use bits, while SQL aliases (Int2, Int4, Int8) use bytes following PostgreSQL/MySQL conventions. Added example comparing Int8 (8-bit) vs INT8 (8-byte).

Co-authored-by: killme2008 <14142+killme2008@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 21, 2025

@copilot
Good, but right now Int8 in GreptimeDB native is bigint too. But like UInt8, INT32, INT64 is still in bits.

...

Updated the note in commit 69d11a0 to clarify the distinction: GreptimeDB native type names (like UInt8, Int32, Int64) use bits, while SQL aliases (Int2, Int4, Int8) use bytes following PostgreSQL/MySQL conventions. Added a clear example showing Int8 (8-bit, 1 byte) vs INT8 alias (8-byte, 64-bit BigInt).

Copilot finished work on behalf of killme2008 November 21, 2025 20:14
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
@killme2008 killme2008 marked this pull request as ready for review November 21, 2025 21:55
@killme2008 killme2008 changed the title Update docs for numeric type aliases aligned with PostgreSQL and MySQL docs: update numeric type aliases aligned with PostgreSQL and MySQL Nov 21, 2025
@killme2008 killme2008 requested a review from sunng87 November 21, 2025 21:56
Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs for fix!: align numeric type aliases with PostgreSQL and MySQL

3 participants