wypoon commented on code in PR #12117:
URL: https://github.com/apache/iceberg/pull/12117#discussion_r1940307001


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/TestSparkDaysFunction.java:
##########
@@ -76,12 +85,32 @@ public void testTimestampNtz() {
     assertThat(scalarSql("SELECT system.days(CAST(null AS 
TIMESTAMP_NTZ))")).isNull();
   }
 
+  @TestTemplate
+  public void testBuiltInDayFunction() {
+    assertThat(scalarSql("SELECT day(date('2017-12-01'))"))
+        .as("Expected to produce 1")
+        .isEqualTo(1);
+    assertThat(scalarSql("SELECT day(date('1969-12-31'))"))
+        .as("Expected to produce 31")
+        .isEqualTo(31);
+    assertThat(scalarSql("SELECT day(TIMESTAMP '2017-12-01 10:12:55.038194 
UTC+00:00')"))
+        .as("Expected to produce 1")
+        .isEqualTo(1);

Review Comment:
   This would fail when run in Jarvis Island (UTC-11), as it would be 
2017-11-30.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to