ryan-johnson-databricks commented on code in PR #43403:
URL: https://github.com/apache/spark/pull/43403#discussion_r1364001231


##########
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:
   (because it seems like we could easily get exceptions even in non-ansi mode, 
for sufficiently broken/illegal timestamp expressions?) 



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