Skip to content

Compatibility of CAST operator. #7119

@alexey-milovidov

Description

@alexey-milovidov

Use case
CAST in ClickHouse work in different way than in other DBMS.

  1. Nullable is the part of data type. When you cast Nullable(UInt8) to String, you will get String.
    In other databases nullability is kept with CAST.

  2. You can specify "conversion instruction" instead of a type name inside CAST.
    Example: CAST(x AS UNSIGNED) will cast Int8 to UInt8, Int16 to UInt16 and so on.

Describe the solution you'd like

  1. Implement cast_keep_nullable setting.
  2. Add a notion of named conversion instructions.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions