Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TRUNCATE TABLE statement #8932

Merged
merged 2 commits into from
Nov 5, 2021
Merged

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Aug 20, 2021

Fixes #8921

Question: Should we implement as DML in Trino? Implementing as DDL simplifies some code around planning.

  • Run test against MemSQL (Oct 19)

@cla-bot cla-bot bot added the cla-signed label Aug 20, 2021
@ebyhr ebyhr force-pushed the ebi/truncate-table branch 7 times, most recently from 48f50f1 to 33839fd Compare August 23, 2021 01:20
@kokosing
Copy link
Member

Question: Should we implement as DML in Trino? Implementing as DDL simplifies some code around planning.

Do you know how ANSI SQL defines TRUNCATE?

@findepi
Copy link
Member

findepi commented Aug 24, 2021

Question: Should we implement as DML in Trino? Implementing as DDL simplifies some code around planning.

Sounds more like "DDL" to me (i.e. could follow the same way as DROP TABLE is done, as they are somewhat similar).

@ebyhr
Copy link
Member Author

ebyhr commented Aug 24, 2021

@ebyhr ebyhr force-pushed the ebi/truncate-table branch from 33839fd to 70c1d4c Compare August 26, 2021 02:57
@ebyhr ebyhr marked this pull request as ready for review August 26, 2021 07:04
@ebyhr
Copy link
Member Author

ebyhr commented Aug 26, 2021

@kokosing Applied comments.

@martint
Copy link
Member

martint commented Aug 26, 2021

DML vs DDL are irrelevant. There's no such a distinction in the SQL standard. In Trino, some things are implemented as DataDefinitionTask for legacy reasons -- i.e., we took a shortcut early on and didn't get around to implementing them as proper execution engine operations (plan IR, etc). That's something we'll eventually do.

@martint
Copy link
Member

martint commented Sep 7, 2021

The syntax matches what's described in the SQL spec, so I remove the syntax-needs-review label.

@ebyhr ebyhr force-pushed the ebi/truncate-table branch from 4cda58f to 6c2adc6 Compare September 21, 2021 01:18
@ebyhr ebyhr force-pushed the ebi/truncate-table branch from 6c2adc6 to 7cecf54 Compare October 7, 2021 14:08
@ebyhr ebyhr force-pushed the ebi/truncate-table branch from 7cecf54 to bb02671 Compare October 15, 2021 02:56
@ebyhr ebyhr requested review from hashhar and kokosing October 19, 2021 04:23
Copy link
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

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

% one comment

@ebyhr ebyhr force-pushed the ebi/truncate-table branch from bb02671 to 517b159 Compare October 19, 2021 08:31
Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Docs part looks good to go.

@ebyhr ebyhr force-pushed the ebi/truncate-table branch 2 times, most recently from d5cb204 to 16b1d88 Compare November 2, 2021 00:42
@ebyhr ebyhr force-pushed the ebi/truncate-table branch from 16b1d88 to 05a8822 Compare November 2, 2021 00:49
@ebyhr ebyhr merged commit 338425d into trinodb:master Nov 5, 2021
@ebyhr ebyhr deleted the ebi/truncate-table branch November 5, 2021 00:16
@ebyhr ebyhr mentioned this pull request Nov 5, 2021
12 tasks
@github-actions github-actions bot added this to the 365 milestone Nov 5, 2021
branimir-vujicic added a commit to axiomq/presto that referenced this pull request Mar 30, 2022
Cherry-pick of trinodb/trino#8932

Co-authored-by: Yuya Ebihara <yuya.ebihara@starburstdata.com>
rschlussel pushed a commit to prestodb/presto that referenced this pull request Mar 30, 2022
Cherry-pick of trinodb/trino#8932

Co-authored-by: Yuya Ebihara <yuya.ebihara@starburstdata.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Support TRUNCATE TABLE statement
6 participants