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



##########
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()),
+    LOCAL_DATE(DateTimeFormatter.ISO_LOCAL_DATE, t -> 
LocalDate.from(t).atStartOfDay(UTC).toInstant());

Review comment:
       I think prefix matching is the better way to think about it. The 
datetime arithmetic is a bit fidgety now but I am happy with the test coverage. 




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