chinmay-bhat commented on code in PR #9401:
URL: https://github.com/apache/iceberg/pull/9401#discussion_r1444346662


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/sql/TestTimestampWithoutZone.java:
##########
@@ -145,33 +137,31 @@ public void testAppendTimestampWithZone() {
                     toTimestamp("2021-02-01T00:00:00.0")))));
   }
 
-  @Test
+  @TestTemplate
   public void testCreateAsSelectWithTimestampWithoutZone() {
     sql("INSERT INTO %s VALUES %s", tableName, rowToSqlValues(values));
 
     sql("CREATE TABLE %s USING iceberg AS SELECT * FROM %s", newTableName, 
tableName);
 
-    Assert.assertEquals(
-        "Should have " + values.size() + " row",
-        (long) values.size(),
-        scalarSql("SELECT count(*) FROM %s", newTableName));
+    assertThat(scalarSql("SELECT count(*) FROM %s", newTableName))
+        .as("Should have " + values.size() + " row")
+        .isEqualTo((long) values.size());

Review Comment:
   looking at the failed tests, we apparently do need the casts. 
   Line 48 shows in the schema, the `id` is a `long`. 
   ```
     private static final Schema schema =
         new Schema(
             Types.NestedField.required(1, "id", Types.LongType.get()),
             Types.NestedField.required(2, "ts", 
Types.TimestampType.withoutZone()),
             Types.NestedField.required(3, "tsz", 
Types.TimestampType.withZone()));
   ```
   
   `scalarSql()` returns the `id` of the row. As its a `long`, we should 
continue using the casts.



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