Do not create temporary staging path for CREATE TABLE statement#14830
Do not create temporary staging path for CREATE TABLE statement#14830phd3 merged 1 commit intotrinodb:masterfrom
Conversation
|
cc: @phd3 |
50a62c3 to
149d23e
Compare
8c9edbb to
4c09730
Compare
There was a problem hiding this comment.
l'd simplify this as below - as we don't care about external location anyway.
Path forNewTable(SemiTransactionalHiveMetastore metastore, ConnectorSession session, String schemaName, String tableName);
There was a problem hiding this comment.
nit: if nothing specific being set - better to remove as this is default ?
There was a problem hiding this comment.
nit: split args once above is inlined
There was a problem hiding this comment.
@phd3 I'll address these comments in next revision.
There was a problem hiding this comment.
@phd3 I have made changes according to your comments above. Please take a look when you have time. Thanks!
There was a problem hiding this comment.
IIUC this comment is suggesting to change split the arguments of the method call on line 3011 to separate lines with principalPrivileges inlined.
967e690 to
dc98ad6
Compare
There was a problem hiding this comment.
I'd actually use a test-local prefix (with a random suffix) - as any reuse of this static variable in future tests can potentially break the assertion
There was a problem hiding this comment.
Makes sense; I'll make the change.
There was a problem hiding this comment.
@phd3 I've addressed this change in the new commit. Please take a look when you have time. Thanks!
dc98ad6 to
3e85252
Compare
3e85252 to
792310e
Compare
Description
I am continuing the work in #5802 .
The issue is that both
CREATE TABLEandCREATE TABLE AS ...useforNewTableto generate aLocationHandle. In subsequent operations the directory created forCREATE TABLEis never renamed as the target directory because there was no data written to it.The solution is to not create any temporary staging directory for
CREATE TABLEoperations. As suggested by the previous discussion I decided to create a new APIforNewTableAsSelectinLocationService, and modify the originalforNewTableto not create any temporary staging directory as it should.Non-technical explanation
Currently during
CREATE TABLEoperation, Trino creates a unnecessary directory that is not used and cleaned up afterwards. This patch will fix this issue.(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: