Skip to content

[Feature] Add expression-based column default values #64635

Description

@nooneuse

Search before asking

  • I had searched in the issues and found no similar issues.

Description

Previously, column DEFAULT values in Doris were primarily treated as literal constants (or a small set of special built-ins such as CURRENT_TIMESTAMP), which limited usability for common patterns like “derive default from current date/time” or “compose a formatted default string”.

Use case

Example (date/datetime defaults):
d DATEV2 NOT NULL DEFAULT to_date(now())
dt DATETIMEV2(3) NOT NULL DEFAULT now(3)
Example (composed string default):
s STRING NOT NULL DEFAULT concat('a-', DATE_FORMAT(now(), '%M %e, %Y'))

Related issues

Not yet

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions