-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Deny DML commands within explicit transactions in Hive #10798
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1624,6 +1624,9 @@ public ConnectorTableHandle beginUpdate(ConnectorSession session, ConnectorTable | |
| if (!isFullAcidTable(table.getParameters())) { | ||
| throw new TrinoException(NOT_SUPPORTED, "Hive update is only supported for ACID transactional tables"); | ||
| } | ||
| if (!autoCommit) { | ||
| throw new TrinoException(NOT_SUPPORTED, "Updating transactional tables is not supported in explicit transactions (use autocommit mode)"); | ||
| } | ||
|
|
||
| // Verify that none of the updated columns are partition columns or bucket columns | ||
|
|
||
|
|
@@ -1723,7 +1726,9 @@ public HiveInsertTableHandle beginInsert(ConnectorSession session, ConnectorTabl | |
| if (isTransactional && retryMode != NO_RETRIES) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "create table as select" can work as "insert into", so the table create in transaction will still be there after rollback... |
||
| throw new TrinoException(NOT_SUPPORTED, "Inserting into Hive transactional tables is not supported with query retries enabled"); | ||
| } | ||
|
|
||
| if (isTransactional && !autoCommit) { | ||
|
findinpath marked this conversation as resolved.
Outdated
|
||
| throw new TrinoException(NOT_SUPPORTED, "Inserting into Hive transactional tables is not supported in explicit transactions (use autocommit mode)"); | ||
| } | ||
| List<HiveColumnHandle> handles = hiveColumnHandles(table, typeManager, getTimestampPrecision(session)).stream() | ||
| .filter(columnHandle -> !columnHandle.isHidden()) | ||
| .collect(toImmutableList()); | ||
|
|
@@ -2425,6 +2430,9 @@ public ConnectorTableHandle beginDelete(ConnectorSession session, ConnectorTable | |
| if (retryMode != NO_RETRIES) { | ||
| throw new TrinoException(NOT_SUPPORTED, "Deleting from Hive tables is not supported with query retries enabled"); | ||
| } | ||
| if (!autoCommit) { | ||
| throw new TrinoException(NOT_SUPPORTED, "Deleting from Hive transactional tables is not supported in explicit transactions (use autocommit mode)"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just tried the scenario of deleting from a non-transactional table that is being partitioned and this worked. I tend to think that it makes sense to keep the transactional table check.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you saying that removing
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The example above would call
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @losipiuk yes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried this functionality on
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tested on
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i fail to understand the response.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @findinpath just dro the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not be strongly against |
||
| } | ||
|
|
||
| LocationHandle locationHandle = locationService.forExistingTable(metastore, session, table); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.