rdblue commented on code in PR #5160:
URL: https://github.com/apache/iceberg/pull/5160#discussion_r910271454


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/source/IcebergSource.java:
##########
@@ -173,7 +174,19 @@ public Optional<String> 
extractTimeTravelVersion(CaseInsensitiveStringMap option
 
   @Override
   public Optional<String> extractTimeTravelTimestamp(CaseInsensitiveStringMap 
options) {
-    return Optional.ofNullable(PropertyUtil.propertyAsString(options, 
"timestampAsOf", null));
+    String timestampAsOf = PropertyUtil.propertyAsString(options, 
"timestampAsOf", null);
+    if (timestampAsOf == null) {
+      return Optional.empty();
+    }
+
+    try {
+      // timestamp provided should be at a seconds precision.
+      // TODO: remove once https://issues.apache.org/jira/browse/SPARK-39633 
is resolved
+      long timestampAsOfAsLong = Long.parseLong(timestampAsOf);
+      return 
Optional.of(DateTimeUtil.formatTimestampMillisWithLocalTime(timestampAsOfAsLong 
* 1000));

Review Comment:
   This needs to be handled by Spark. Iceberg should not translate to a 
zone-specific time because that is what Spark expects..



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