[ https://issues.apache.org/jira/browse/HIVE-26995?focusedWorklogId=841934&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-841934 ]
ASF GitHub Bot logged work on HIVE-26995: ----------------------------------------- Author: ASF GitHub Bot Created on: 27/Jan/23 07:38 Start Date: 27/Jan/23 07:38 Worklog Time Spent: 10m Work Description: kasakrisz commented on code in PR #3988: URL: https://github.com/apache/hive/pull/3988#discussion_r1088657424 ########## 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: Should an exception be thrown if the expression can not be evaluated at compile time? It might be worth adding some negative test cases to cover this code path. Issue Time Tracking ------------------- Worklog Id: (was: 841934) Time Spent: 0.5h (was: 20m) > 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: 0.5h > 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)