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

Add support for TRUNCATE statement in memory connector #22337

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Jun 9, 2024

Description

Relates to #22208

Release notes

# Memory
* Add support for `TRUNCATE` statement. ({issue}`22337`)

@cla-bot cla-bot bot added the cla-signed label Jun 9, 2024
@github-actions github-actions bot added the docs label Jun 9, 2024
@ebyhr ebyhr merged commit 22da322 into trinodb:master Jun 10, 2024
54 checks passed
@ebyhr ebyhr deleted the ebi/memory-truncate-table branch June 10, 2024 23:06
@github-actions github-actions bot added this to the 450 milestone Jun 10, 2024
@cpcloud
Copy link
Contributor

cpcloud commented Jul 13, 2024

This doesn't seem to work on Trino 452 from the CLI:

trino:default> create table t (x int);                                                                                
CREATE TABLE
trino:default> insert into t values (1), (2), (3);                                                                    
INSERT: 3 rows

Query 20240713_225914_01546_iphh3, FINISHED, 1 node
Splits: 11 total, 11 done (100.00%)
0.09 [0 rows, 0B] [0 rows/s, 0B/s]

trino:default> select count(*) from t;                                                                                
 _col0
-------
     3
(1 row)

Query 20240713_225919_01549_iphh3, FINISHED, 1 node
Splits: 13 total, 13 done (100.00%)
0.12 [3 rows, 0B] [24 rows/s, 0B/s]

trino:default> create table s as select * from t;                                                                     
CREATE TABLE: 3 rows

Query 20240713_225926_01556_iphh3, FINISHED, 1 node
Splits: 18 total, 18 done (100.00%)
0.13 [3 rows, 15B] [23 rows/s, 118B/s]

trino:default> truncate table t;                                                                                      
TRUNCATE TABLE
trino:default> select count(*) from t;
 _col0
-------
     0
(1 row)

Query 20240713_225938_01566_iphh3, FINISHED, 1 node
Splits: 6 total, 6 done (100.00%)
0.14 [0 rows, 0B] [0 rows/s, 0B/s]

trino:default> select count(*) from s;
 _col0
-------
     3
(1 row)

Query 20240713_225946_01573_iphh3, FINISHED, 1 node
Splits: 13 total, 13 done (100.00%)
0.13 [3 rows, 0B] [23 rows/s, 0B/s]

trino:default> insert into t select * from s;                                                                         
INSERT: 3 rows

Query 20240713_225952_01578_iphh3, FINISHED, 1 node
Splits: 18 total, 18 done (100.00%)
0.07 [3 rows, 15B] [41 rows/s, 208B/s]

trino:default> select count(*) from t;                                                                                
 _col0
-------
     6
(1 row)

gforsyth pushed a commit to ibis-project/ibis that referenced this pull request Jul 14, 2024
Pin trino for now until the truncate table statement for in-memory
connector can be fixed. See
trinodb/trino#22337 (comment) for
a reproducer.
@cpcloud
Copy link
Contributor

cpcloud commented Jul 27, 2024

This still seems to be broken.

@martint
Copy link
Member

martint commented Jul 27, 2024

@cpcloud, thanks for the report. Can you file an issue so that we can track it separately?

@cpcloud
Copy link
Contributor

cpcloud commented Jul 27, 2024

Oops, yep! Will do early next week.

@ebyhr
Copy link
Member Author

ebyhr commented Jul 27, 2024

We already have the issue. #22665

@cpcloud
Copy link
Contributor

cpcloud commented Jul 27, 2024

We already have the issue. #22665

Ah right, I forgot! Thanks!

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.

4 participants