marton-bod commented on a change in pull request #2512:
URL: https://github.com/apache/hive/pull/2512#discussion_r677499156



##########
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:
       Understood, thanks




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to