Search before asking
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?
Code of Conduct
Search before asking
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?
Code of Conduct