Skip to content

Conversation

@ebyhr
Copy link
Member

@ebyhr ebyhr commented Apr 27, 2025

Description

This PR adds support for the DEFAULT clause with literal values when creating a new table or adding a column.
The SHOW CREATE TABLE statement now includes the specified default values.
These defaults are respected in INSERT and MERGE operations.
Non-literal expressions such as <datetime value function>, USER, and similar are not supported in this PR.

<default clause> ::=
  DEFAULT <default option> 

<default option> ::=
    <literal> 
  | <datetime value function> 
  | USER
  | CURRENT_USER
  | CURRENT_ROLE
  | SESSION_USER
  | SYSTEM_USER
  | CURRENT_CATALOG
  | CURRENT_SCHEMA
  | CURRENT_PATH
  | <implicitly typed value specification> 

Release notes

## General, Memory
* Add support for default column values. ({issue}`25679`)

@cla-bot cla-bot bot added the cla-signed label Apr 27, 2025
@github-actions github-actions bot added iceberg Iceberg connector delta-lake Delta Lake connector hive Hive connector bigquery BigQuery connector mongodb MongoDB connector cassandra Cassandra connector ignite Ignite connector memory Memory connector labels Apr 27, 2025
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch from 796b75e to 9b59d7c Compare May 5, 2025 12:16
@ebyhr ebyhr marked this pull request as ready for review May 5, 2025 12:31
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch from 9b59d7c to 30ab353 Compare May 5, 2025 12:51
@github-actions github-actions bot added the docs label May 5, 2025
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch 3 times, most recently from 3eae180 to 2e3b139 Compare May 5, 2025 23:31
@ebyhr ebyhr requested a review from martint May 5, 2025 23:34
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch 2 times, most recently from b905a01 to d75264c Compare May 6, 2025 01:10
@ebyhr ebyhr requested review from Praveen2112 and kasiafi May 12, 2025 03:10
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch from d75264c to 995de6e Compare May 12, 2025 23:36
@ebyhr
Copy link
Member Author

ebyhr commented May 12, 2025

Addressed comments.

@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch 3 times, most recently from cecbfec to 62525ca Compare May 14, 2025 04:50
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch 3 times, most recently from 1c31f22 to a7ae149 Compare June 23, 2025 03:41
@ebyhr ebyhr requested a review from martint June 23, 2025 06:05
Copy link
Member

@martint martint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general approach looks good now. @kasiafi can you take a look?

@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch 2 times, most recently from 0ef9501 to 2b22f99 Compare June 30, 2025 05:27
@ebyhr
Copy link
Member Author

ebyhr commented Jun 30, 2025

(Rebased on master to resolve logical conflicts)

@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch 2 times, most recently from d9ba7a2 to 640b8c8 Compare July 1, 2025 05:00
Copy link
Member

@kasiafi kasiafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@martint PTAL

@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch from 640b8c8 to e682a64 Compare July 7, 2025 08:18
@ebyhr
Copy link
Member Author

ebyhr commented Jul 7, 2025

Rebased on master to resolve conflicts.

@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch from e682a64 to 3acab76 Compare July 7, 2025 21:41
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch from 3acab76 to 16f8d3e Compare July 8, 2025 03:50
@ebyhr ebyhr force-pushed the ebi/engine-default-column-values branch from 16f8d3e to 271bdcd Compare July 8, 2025 07:10
@ebyhr
Copy link
Member Author

ebyhr commented Jul 8, 2025

CI hit #14895

@ebyhr
Copy link
Member Author

ebyhr commented Jul 9, 2025

Let me merge this PR since Martin has agreed on the general approach. I'll follow up with additional PRs if needed.

@ebyhr ebyhr merged commit 4f2280f into trinodb:master Jul 9, 2025
98 of 99 checks passed
@ebyhr ebyhr deleted the ebi/engine-default-column-values branch July 9, 2025 21:50
@github-actions github-actions bot added this to the 477 milestone Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bigquery BigQuery connector cassandra Cassandra connector cla-signed delta-lake Delta Lake connector docs hive Hive connector iceberg Iceberg connector ignite Ignite connector memory Memory connector mongodb MongoDB connector

Development

Successfully merging this pull request may close these issues.

6 participants