cloud-fan commented on code in PR #43403:
URL: https://github.com/apache/spark/pull/43403#discussion_r1364005044
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TimeTravelSpec.scala:
##########
@@ -65,4 +66,36 @@ object TimeTravelSpec {
None
}
}
+
+ def fromOptions(
+ options: CaseInsensitiveStringMap,
+ timestampKey: String,
+ versionKey: String,
+ sessionLocalTimeZone: String): Option[TimeTravelSpec] = {
+ val timestampStr = options.get(timestampKey)
+ val versionStr = options.get(versionKey)
+ if (timestampStr != null && versionStr != null) {
+ throw QueryCompilationErrors.invalidTimeTravelSpecError()
+ }
+
+ if (timestampStr != null) {
+ val timestampValue = Cast(
+ Literal(timestampStr),
+ TimestampType,
+ Some(sessionLocalTimeZone),
+ ansiEnabled = false
Review Comment:
We intentionally turn off ansi here so it doesn't fail, and we can customize
the error message later.
--
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]