All Products
Search
Document Center

Common syntax

Last Updated: Jan 04, 2020

Constants

  • INT_VALUE: matches integer constants, such as 123.
  • DECIMAL_VALUE: matches fixed-point constants, such as 123.456.
  • STR_VALUE: matches string constants, such as abc.
  • NULL: matches a NULL constant.
  • STORAGE_SIZE: matches storage length constants. The default unit is bytes for integer constants. M and G are units for string constants. For example, the storage size can be 1024 or '500M'.
  1. const_value:
  2. INT_VALUE
  3. | DECIMAL_VALUE
  4. | STR_VALUE
  5. | NULL
  6. | STORAGE_SIZE
  7. STORAGE_SIZE:
  8. INT_VALUE
  9. | 'INT_VALUE[M|G]'

Character sets

  1. charset:
  2. default_charset
  3. | column_charset
  4. default_charset:
  5. [DEFAULT] {CHARSET | CHARACTER SET} [=] {UTF8 | UTF8MB4 | BINARY}
  6. column_charset:
  7. {CHARSET | CHARACTER SET} {UTF8 | UTF8MB4 | BINARY}

Collations

  1. collate:
  2. default_collate
  3. | column_collate
  4. default_collate:
  5. [DEFAULT] COLLATE [=] {UTF8MB4_GENERAL_CI | UTF8MB4_BIN | BINARY}
  6. column_collate:
  7. COLLATE {UTF8MB4_GENERAL_CI | UTF8MB4_BIN | BINARY}

Data types

  1. data_type:
  2. TINYINT[(precision)] [UNSIGNED] [ZEROFILL]
  3. | SMALLINT[(precision)] [UNSIGNED] [ZEROFILL]
  4. | MEDIUMINT[(precision)] [UNSIGNED] [ZEROFILL]
  5. | INT[(precision)] [UNSIGNED] [ZEROFILL]
  6. | INTEGER[(precision)] [UNSIGNED] [ZEROFILL]
  7. | BIGINT[(precision)] [UNSIGNED] [ZEROFILL]
  8. | FLOAT[(precision, scale)] [UNSIGNED] [ZEROFILL]
  9. | DOUBLE[(precision, scale)] [UNSIGNED] [ZEROFILL]
  10. | DECIMAL[(precision [, scale])] [UNSIGNED] [ZEROFILL]
  11. | NUMERIC[(precision [, scale])] [UNSIGNED] [ZEROFILL]
  12. | DATETIME[(scale)]
  13. | TIMESTAMP[(scale)]
  14. | DATE
  15. | TIME[(scale)]
  16. | YEAR
  17. | VARCHAR(length) column_charset column_collate
  18. | VARBINARY(length)
  19. | CHAR[(length)] column_charset column_collate
  20. | BINARY[(length)]
  21. | TINYTEXT column_charset column_collate
  22. | TINYLOB
  23. | TEXT[(length)] column_charset column_collate
  24. | BLOB[(length)]
  25. | MEDIUMTEXT column_charset column_collate
  26. | MEDIUMBLOB
  27. | LONGTEXT column_charset column_collate
  28. | LONGBLOB
  29. precision | scale | length:
  30. INT_VALUE

SQL attributes

  • Object names
  1. tenant_name | pool_name | unit_name | zone_name | region_name:
  2. STR_VALUE
  3. database_name | table_name | table_alias_name | column_name| column_alias_name | partition_name | subpartition_name:
  4. STR_VALUE
  5. index_name | view_name | object_name | constraint_name | tablegroup_name:
  6. STR_VALUE
  7. outline_name | user_name:
  8. STR_VALUE
  9. table_factor:
  10. [[database_name].] table_name
  11. column_factor:
  12. [table_factor.] column_name
  • Expressions
  1. expression:
  2. const_value
  3. | column_factor
  4. | operator_expression
  5. | function_expression
  • Description
  1. comment:
  2. COMMENT 'comment_text'
  3. comment_text:
  4. STR_VALUE

Distributed system attributes

  • PRIMARY_ZONE: specifies the distribution strategy for the leader.
  1. primary_zone:
  2. PRIMARY_ZONE [=] zone_name
  • ZONE_LIST: specifies the resource distribution strategy of the tenant.
  1. zone_list:
  2. ZONE_LIST [=] (zone_name [, zone_name ...])
  • REPLICA_NUM: specifies the number of replicas for the data.
  1. replica_num:
  2. REPLICA_NUM [=] INT_VALUE
  • TABLEGROUP: specifies the distribution strategy for the primary data and the replicas of multiple data sets.
  1. tablegroup:
  2. default_tablegroup
  3. | table_tablegroup
  4. default_tablegroup:
  5. DEFAULT TABLEGROUP [=] {tablegroup_name | NULL}
  6. table_tablegroup:
  7. TABLEGROUP [=] {tablegroup_name | NULL}

Storage attributes

  • BLOCK_SIZE: specifies the microblock size for object storage.
  1. block_size:
  2. BLOCK_SIZE [=] INT_VALUE
  • COMPRESSION: specifies the compression algorithm for object storage.
  1. compression:
  2. COMPRESSION [=] {NONE | LZ4_1.0 | LZ0_1.0 | SNAPPY_1.0 | ZLIB_1.0}
  • PCTFREE: specifies the macroblock reserve ratio for object storage.
  1. pctfree:
  2. PCTFREE [=] INT_VALUE
  • TABLET_SIZE: specifies the minimum size of each data shard for parallel compaction in a single task.
  1. tablet_size:
  2. TABLET_SIZE [=] INT_VALUE