[ 
https://issues.apache.org/jira/browse/HIVE-25344?focusedWorklogId=628461&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-628461
 ]

ASF GitHub Bot logged work on HIVE-25344:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jul/21 13:53
            Start Date: 27/Jul/21 13:53
    Worklog Time Spent: 10m 
      Work Description: pvary commented on a change in pull request #2512:
URL: https://github.com/apache/hive/pull/2512#discussion_r677472483



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -2223,6 +2237,22 @@ private void getMetaData(QB qb, ReadEntity parentInput)
         }
       }
 
+      Pair<String, String> asOf = qb.getAsOfForAlias(alias);
+      if (asOf != null) {
+        if 
(!Optional.ofNullable(tab.getStorageHandler()).map(HiveStorageHandler::isTimeTravelAllowed).orElse(false))
 {
+          throw new SemanticException(ErrorMsg.TIME_TRAVEL_NOT_ALLOWED, alias);
+        }
+        if (asOf.getLeft() != null) {
+          tab.setAsOfVersion(Long.parseLong(asOf.getLeft()));
+        }
+        if (asOf.getRight() != null) {
+          ZoneId timeZone = SessionState.get() == null ? new 
HiveConf().getLocalTimeZone() :
+                                 
SessionState.get().getConf().getLocalTimeZone();
+          TimestampTZ ts = TimestampTZUtil.parse(stripQuotes(asOf.getRight()), 
timeZone);

Review comment:
       Only it the user does not provide the TZ in the string. Same as 
everywhere in Hive for the `TIMESTAMP WITH LOCAL TIMEZONE` types




-- 
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-unsubscr...@hive.apache.org

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 628461)
    Time Spent: 1.5h  (was: 1h 20m)

> Add a possibility to query Iceberg table snapshots based on the timestamp or 
> the snapshot id
> --------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25344
>                 URL: https://issues.apache.org/jira/browse/HIVE-25344
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Implement the following commands:
> {code:java}
> SELECT * FROM t FOR SYSTEM_TIME AS OF <timestamp>;
> SELECT * FROM t FOR SYSTEM_VERSION AS OF <version>;{code}
> where SYSTEM_TIME is the Iceberg table state at the given timestamp (UTC), or 
> SYSTEM_VERSION is the Iceberg table snapshot id.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to