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


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/TestSparkHoursFunction.java:
##########
@@ -61,13 +68,28 @@ public void testTimestampsNtz() {
     assertThat(scalarSql("SELECT system.hours(CAST(null AS 
TIMESTAMP_NTZ))")).isNull();
   }
 
+  @TestTemplate
+  public void testBuiltInHourFunction() {
+    String tz = TimeZone.getDefault().getID();
+    assertThat(scalarSql(String.format("SELECT hour(TIMESTAMP '2017-12-01 
10:12:55 %s')", tz)))
+        .as("Expected to produce 10")
+        .isEqualTo(10);

Review Comment:
   Note: This is how Spark SQL's TIMESTAMP_LTZ support works. The instance in 
time is converted to the local timezone and the hour function is applied to 
that. Thus if the instance in time is already specified using the local 
timezone, when converted the hour hasn't changed, so we know what it is.



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