Lakehouse Object Naming Rules

In Lakehouse, a set of naming rules has been established to ensure consistency and readability in metadata naming (such as databases, tables, views, users, etc.) and to avoid potential issues. This document describes these rules in detail to help you better understand and use Lakehouse.

Identifier Types

Lakehouse supports the following types of identifier naming:

  • Regular identifiers: No quotes required, but must comply with specific naming rules.
  • Double-quoted identifiers: Must be surrounded by double quotes ("), allowing keywords to be used as identifier names. Disabled by default; enable with SET cz.sql.double.quoted.identifiers=true (session level only). Note: Once enabled, double quotes no longer represent strings — "hello" is parsed as an identifier, not a string value.
  • Backtick identifiers: Must be surrounded by backticks (`). For column names, backticks allow any characters (hyphens, spaces, Chinese characters, numeric prefixes, etc.); for table names, schema names, and other object names, backticks only bypass keyword restrictions and numeric-prefix restrictions — special characters such as hyphens, spaces, and Chinese characters are still not allowed. Backticks are used by default; switch to double quotes with SET cz.sql.double.quoted.identifiers=true.

Naming Rules

Regular Identifier Naming Conventions

  1. Starting character: Identifiers must start with a letter (uppercase A-Z or lowercase a-z) or an underscore (_). Starting with a digit or other special character is not allowed.
  2. Character composition: Identifiers may only contain letters, underscores, and decimal digits (0-9). Other special characters and keywords such as hyphens (-), spaces, or other non-alphanumeric characters are not allowed.
  3. Case sensitivity: Metadata undergoes case conversion during storage. Most objects (schema, table, view, column, etc.) are stored in lowercase; VCluster names are an exception and are stored in uppercase. References are case-insensitive — MyTable and mytable are treated as the same identifier. Backticks also cannot preserve case. Note: Column aliases in SELECT queries (AS MyAlias) preserve their original case and are not converted.
  4. Language restriction: Chinese characters are not supported.
  5. Length limit: 1–256 characters; WORKSPACE NAME is limited to 3–28 characters.

Examples of valid identifiers:

my_table table1 table_2

Backtick Identifiers

The behavior of backticks differs by object type:

For column names: Backticks bypass all naming restrictions, allowing hyphens, spaces, Chinese characters, numeric prefixes, and any other characters:

CREATE TABLE my_table( `my-col` INT, `my col` STRING, `chinese_col` DATE, `123col` BIGINT )

For table names, schema names, and other object names: Backticks only bypass keyword restrictions and numeric-prefix restrictions; special characters such as hyphens, spaces, and Chinese characters are still not allowed:

-- Numeric prefix allowed CREATE SCHEMA `123`; -- Keyword as name allowed CREATE SCHEMA `select`; -- Chinese column names (column names only) CREATE TABLE my_table(`chinese_col` STRING);

Use backticks only when necessary.

Double-Quoted Identifiers

After enabling SET cz.sql.double.quoted.identifiers=true, double quotes act as identifier delimiters, compatible with SQL ANSI/ISO standard behavior. After enabling, note:

  • Double quotes no longer represent strings; "hello" is parsed as an identifier (column name/object name), not a string value
  • Objects created with keywords using double quotes must be referenced with double quotes

-- Enable double-quoted identifier mode SET cz.sql.double.quoted.identifiers=true; -- Use a keyword as a schema name CREATE SCHEMA "select"; -- Must use double quotes when referencing SELECT * FROM "select".my_table;

Naming Rules for Each Object Type

Instance (INSTANCE NAME)

ConstraintCondition
Name rulesNaming ruleGenerated by the system; starts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limit3–28 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsNone
DuplicatesUnique identifier for the user's Lakehouse

WORKSPACE

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limit3–28 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsReserved word: sys
DuplicatesNot allowed within the current instance
COMMENTNaming ruleStarts with a letter or Chinese character
Length limitNo more than 1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed in the middle
Chinese charactersSupported
Case sensitivityCase-sensitive

SCHEMA

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsReserved words: information_schema, public
DuplicatesNot allowed within the current WORKSPACE; cannot duplicate a VOLUME name
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9)
Chinese charactersSupported
Case sensitivityCase-sensitive

TABLE

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsNone
DuplicatesNot allowed within the current schema
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive

VIEW

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsNone
DuplicatesNot allowed within the current schema
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive

VIRTUAL CLUSTER

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Lowercase letters are converted to uppercase (opposite of other objects).
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
DuplicatesNot allowed within the current workspace
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive

COLUMN

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase; backticks support special characters, Chinese characters, and numeric prefixes.
Length limitMaximum 1–256 characters
Special charactersNot supported for regular identifiers; backtick identifiers support hyphens, spaces, and other special characters
Chinese charactersSupported (requires backticks, e.g., `chinese_col`)
Reserved wordsReserved words exist
DuplicatesNot allowed within the current table
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive

VOLUME

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsReserved words exist
DuplicatesNot allowed within the current workspace; cannot duplicate a schema name
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive

FUNCTION

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase; avoid duplicating built-in function names.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsReserved words exist
DuplicatesDuplicates allowed; distinguished by input parameters
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive

ROLE

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsReserved roles exist
DuplicatesNot allowed within the current instance
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive
ROLE_ALIASNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-insensitive

USER

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsReserved words exist (e.g., USER)
DuplicatesNot allowed within the current Account
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive

INDEX

ConstraintCondition
Name rulesNaming ruleStarts with a letter (A-Z, a-z) or underscore (_). Uppercase letters are converted to lowercase.
Length limitMaximum 1–256 characters
Special charactersOnly letters, underscores, and decimal digits (0-9); spaces not allowed
Chinese charactersNot supported
Reserved wordsReserved words exist
DuplicatesNot allowed within the current schema; an index must be in the same schema as its table
COMMENTNaming ruleStarts with a letter or Chinese character
Length limit1024 characters
Special charactersLetters, Chinese characters, underscores, decimal digits (0-9); spaces allowed
Chinese charactersSupported
Case sensitivityCase-sensitive