You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "deniskuzZ (via GitHub)" <gi...@apache.org> on 2023/01/27 08:59:59 UTC

[GitHub] [hive] deniskuzZ commented on a diff in pull request #3988: HIVE-26995: Iceberg: Enhance time travel syntax with expressions

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:
   👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org