HIVE-28763: Iceberg: Support functions while expiring snapshots. - #5643
Merged
Conversation
okumin
reviewed
Feb 17, 2025
| | KW_EXECUTE KW_CHERRY_PICK snapshotId=Number | ||
| -> ^(TOK_ALTERTABLE_EXECUTE KW_CHERRY_PICK $snapshotId) | ||
| | KW_EXECUTE KW_EXPIRE_SNAPSHOTS KW_BETWEEN (fromTimestamp=StringLiteral) KW_AND (toTimestamp=StringLiteral) | ||
| | KW_EXECUTE KW_EXPIRE_SNAPSHOTS KW_BETWEEN |
Contributor
There was a problem hiding this comment.
Suggested change
| | KW_EXECUTE KW_EXPIRE_SNAPSHOTS KW_BETWEEN | |
| | KW_EXECUTE KW_EXPIRE_SNAPSHOTS KW_BETWEEN |
| QueryState queryState = new QueryState.Builder().withGenerateNewQueryId(false).withHiveConf(conf).build(); | ||
| SemanticAnalyzer sem = (SemanticAnalyzer) SemanticAnalyzerFactory.get(queryState, node); | ||
| ExprNodeDesc desc = sem.genExprNodeDesc(node, new RowResolver(), false, true); | ||
| ExprNodeConstantDesc constantDesc = (ExprNodeConstantDesc) desc; |
Contributor
There was a problem hiding this comment.
I'd check if it is a constant or not. This throws ClassCastException.
shell.executeStatement("ALTER TABLE " + identifier.name() + " EXECUTE EXPIRE_SNAPSHOTS(RAND())");
Additionally, we may check whether the type of constantDesc is acceptable here.
Member
Author
There was a problem hiding this comment.
I added a check that desc is of type ExprNodeConstantDesc, whether constantDesc is acceptable or not I think the original logic should take care, It should throw some DateTimeParsing exception, same as in case some one provides non timestamp string
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changes were proposed in this pull request?
Allow specifying functions while expiring snapshots
Why are the changes needed?
Better Usability
Does this PR introduce any user-facing change?
Yes, Expire Snapshots allows valid expressions
Is the change a dependency upgrade?
No
How was this patch tested?
UT