[
https://issues.apache.org/jira/browse/HIVE-26995?focusedWorklogId=841962&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-841962
]
ASF GitHub Bot logged work on HIVE-26995:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Jan/23 08:59
Start Date: 27/Jan/23 08:59
Worklog Time Spent: 10m
Work Description: deniskuzZ commented on code in PR #3988:
URL: https://github.com/apache/hive/pull/3988#discussion_r1088719577
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -1133,7 +1133,20 @@ private String processTable(QB qb, ASTNode tabref)
throws SemanticException {
if (asOfTimeIndex != -1 || asOfVersionIndex != -1) {
String asOfVersion = asOfVersionIndex == -1 ? null :
tabref.getChild(asOfVersionIndex).getChild(0).getText();
- String asOfTime = asOfTimeIndex == -1 ? null :
tabref.getChild(asOfTimeIndex).getChild(0).getText();
+ String asOfTime = null;
+
+ if (asOfTimeIndex != -1) {
+ ASTNode expr = (ASTNode) tabref.getChild(asOfTimeIndex).getChild(0);
+ if (expr.getChildCount() > 0) {
+ ExprNodeDesc desc = genExprNodeDesc(expr, null, false, true);
+ if (desc instanceof ExprNodeConstantDesc) {
+ ExprNodeConstantDesc c = (ExprNodeConstantDesc) desc;
+ asOfTime = String.valueOf(c.getValue());
+ }
Review Comment:
👍
Issue Time Tracking
-------------------
Worklog Id: (was: 841962)
Time Spent: 40m (was: 0.5h)
> Iceberg: Enhance time travel syntax with expressions
> ----------------------------------------------------
>
> Key: HIVE-26995
> URL: https://issues.apache.org/jira/browse/HIVE-26995
> Project: Hive
> Issue Type: Task
> Reporter: Denys Kuzmenko
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Allow expressions in time travel queries, such as
> {code}
> FOR SYSTEM_TIME AS OF CURRENT_TIMESTAMP - interval '10' hours
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)