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

Fix handling of inserting into non-bucketed ACID tables #8899

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

losipiuk
Copy link
Member

No description provided.

@cla-bot cla-bot bot added the cla-signed label Aug 17, 2021
@losipiuk losipiuk requested a review from hashhar August 17, 2021 12:35
Copy link
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

Looks good to me % a few questions.

@@ -2517,7 +2517,8 @@ else if (hasNaN) {
}
}
// treat un-bucketed transactional table as having a single bucket on no columns
else if (hiveTableHandle.isInAcidTransaction()) {
// Note: we cannot use hiveTableHandle.isInAcidTransaction() here as transaction is not yet set in HiveTableHandle when getInsertLayout is called
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand this?
I can see that we do set the transaction in the HiveInsertTableHandle in beginInsert.

Is it because the engine calls getInsertLayout during planning (i.e. before execution when beginInsert would be called?)?

Copy link
Member

Choose a reason for hiding this comment

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

The only other existing use I can see of the method is in

checkArgument(hiveTableHandle.isInAcidTransaction(), "Not in a transaction; hiveTableHandle: %s", hiveTableHandle);
which seems to be okay.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it because the engine calls getInsertLayout during planning (i.e. before execution when beginInsert would be called?)?

Yeah - exactly. We are operating on TableHandle which is obtained by HiveMetadata.getTableHandle here. And the transaction field is set to NO_ACID_TRANSACTION there.

@losipiuk losipiuk merged commit 856cef2 into trinodb:master Aug 18, 2021
@losipiuk losipiuk mentioned this pull request Aug 18, 2021
10 tasks
@ebyhr ebyhr added this to the 361 milestone Aug 19, 2021
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.

3 participants