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


##########
api/src/test/java/org/apache/iceberg/expressions/TestExpressionHelpers.java:
##########
@@ -57,6 +59,56 @@
 public class TestExpressionHelpers {
   private final UnboundPredicate<?> pred = lessThan("x", 7);
 
+  @Test
+  public void testMillisLiteral() {
+    long now = System.currentTimeMillis();
+    Literal<Long> millis = Expressions.millis(now);
+    assertThat(millis.value()).isEqualTo(now * 1000L);
+    
assertThat(millis.to(Types.TimestampNanoType.withZone()).value()).isEqualTo(now 
* 1_000_000L);
+  }
+
+  @Test
+  public void testMicrosLiteal() {
+    long ts = 1510842668000000L;
+    Literal<Long> micros = Expressions.micros(ts);
+    assertThat(micros.value()).isEqualTo(ts);
+    
assertThat(micros.to(Types.TimestampNanoType.withZone()).value()).isEqualTo(ts 
* 1000L);
+  }
+
+  @Test
+  public void testNanosLiteral() {
+    long ts = 1510842668000000001L;
+    Literal<Long> nanos = Expressions.nanos(ts);
+    assertThat(nanos.value()).isEqualTo(ts);
+    
assertThat(nanos.to(Types.TimestampType.withoutZone()).value()).isEqualTo(1510842668000000L);
+  }
+
+  @Test
+  public void testMixedTimestampLiterals() {

Review Comment:
   This tests the IN case mentioned in the original thread.



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