rymurr commented on a change in pull request #1825:
URL: https://github.com/apache/iceberg/pull/1825#discussion_r533370494



##########
File path: nessie/src/main/java/org/apache/iceberg/nessie/TableReference.java
##########
@@ -83,12 +95,49 @@ public static TableReference parse(String path) {
     }
 
     if (path.contains("#")) {
-      throw new IllegalArgumentException("Invalid table name:" +
-          " # is not allowed (reference by timestamp is not supported)");
+      String[] tableTimestamp = path.split("#");
+      TableIdentifier identifier = TableIdentifier.parse(tableTimestamp[0]);
+      return new TableReference(identifier, parseTimestamp(tableTimestamp[1]), 
null);
     }
 
     TableIdentifier identifier = TableIdentifier.parse(path);
 
     return new TableReference(identifier, null, null);
   }
+
+  private enum FormatOptions {
+    DATE_TIME(DateTimeFormatter.ISO_DATE_TIME, Instant::from),
+    LOCAL_DATE_TIME(DateTimeFormatter.ISO_LOCAL_DATE_TIME, t -> 
LocalDateTime.from(t).atZone(UTC).toInstant()),

Review comment:
       These are to parse the given ISO timestamp into an Instant. If the given 
timestamp has a timezone on it it will be parsed by `DATE_TIME` with the 
timezone and relocated to UTC for the instant. If it doesn't have a timezone it 
will be parsed as a UTC timestamp and if it doesn't have a time at all it will 
be given midnight at UTC for that date. I believe this is what happens in the 
tests, I reran w/ a variety of interesting timezones to verify.




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

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