ahmedabu98 commented on code in PR #39592:
URL: https://github.com/apache/beam/pull/39592#discussion_r3708113646


##########
sdks/java/extensions/sql/iceberg/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/iceberg/IcebergReadWriteIT.java:
##########
@@ -200,8 +201,10 @@ public void runSqlWriteAndRead(boolean withPartitionFields)
     assertEquals("my_catalog." + tableIdentifier, icebergTable.name());
     assertTrue(icebergTable.location().startsWith(warehouse));
     assertEquals(expectedSpec, icebergTable.spec());
-    Schema expectedSchema = 
checkStateNotNull(metastore.getTable(tableName)).getSchema();
-    assertEquals(expectedSchema, 
IcebergUtils.icebergSchemaToBeamSchema(icebergTable.schema()));
+    Schema fromIceberg = 
IcebergUtils.icebergSchemaToBeamSchema(icebergTable.schema());
+    assertEquals(
+        FieldType.logicalType(Timestamp.MICROS).withNullable(true),
+        fromIceberg.getField("c_timestamp").getType());

Review Comment:
   I would remove the assertion here because it's misleading. The original 
assertion was intended to check the SQL table's schema



##########
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java:
##########
@@ -439,6 +439,12 @@ static Object toBeamObject(Object value, FieldType 
fieldType, boolean verifyValu
               LocalDate.ofEpochDay(((Number) value).longValue() / 
MILLIS_PER_DAY),
               LocalTime.ofNanoOfDay(
                   (((Number) value).longValue() % MILLIS_PER_DAY) * 
NANOS_PER_MILLISECOND));
+        } else if 
(org.apache.beam.sdk.schemas.logicaltypes.Timestamp.IDENTIFIER.equals(

Review Comment:
   Can we add some unit tests (non-iceberg) to validate the additions in this 
file?



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

Reply via email to