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