All Products
Search
Document Center

Common syntax

Last Updated: Jan 10, 2020

Constants

  • INT_VALUE: matches integer type constants, such as 123.
  • DECIMAL_VALUE: matches fixed-point type constants, such as 123.456.
  • STR_VALUE: matches string constants, such as abc.
  • NULL: matches a NULL constant.
  • STORAGE_SIZE: matches storage length constants. For integer constants, the default unit is byte. For string constants, the unit can be M or G. 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. SMALLINT
  3. | INT
  4. | INTEGER
  5. | DECIMAL[(precision [, scale])]
  6. | NUMERIC[(precision [, scale])]
  7. | NUMBER[(precision [, scale])]
  8. | DATE
  9. | TIMESTAMP[(scale)]
  10. | TIMESTAMP[(scale)] WITH TIME ZONE
  11. | TIMESTAMP[(scale)] WITH LOCAL TIME ZONE
  12. | CHAR[(length [CHAR | BYTE])] column_charset column_collate
  13. | CHARACTER[(length [CHAR | BYTE])] column_charset column_collate
  14. | VARCHAR[(length [CHAR | BYTE])] column_charset column_collate
  15. | VARCHAR2[(length [CHAR | BYTE])] column_charset column_collate
  16. | VARCHARACTER[(length [CHAR | BYTE])] column_charset column_collate
  17. | RAW(length)
  18. | BLOB
  19. | CLOB column_charset column_collate
  20. precision | scale | length:
  21. INT_VALUE

SQL properties

  • 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
  • Comments

    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 of the leaders for 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