zstan commented on code in PR #1323:
URL: https://github.com/apache/ignite-3/pull/1323#discussion_r1018696063


##########
modules/table/src/test/java/org/apache/ignite/internal/table/MutableRowTupleAdapterTest.java:
##########
@@ -543,6 +543,110 @@ public void testKeyValueSerialization() throws Exception {
         assertEquals(val1, val2);
     }
 
+    @Test
+    void testTemporalValuesPrecisionWidening() throws Exception {
+        SchemaDescriptor schemaDescriptor = new SchemaDescriptor(1,
+                new Column[]{new Column("key", NativeTypes.INT32, false)},
+                new Column[]{
+                        new Column("time", NativeTypes.time(3), true),
+                        new Column("datetime", NativeTypes.datetime(4), true),
+                        new Column("timestamp", NativeTypes.timestamp(5), true)
+                }
+        );
+
+        TupleMarshaller marshaller = new TupleMarshallerImpl(new 
DummySchemaManagerImpl(schemaDescriptor));
+
+        Tuple tuple = Tuple.create().set("key", 1)
+                .set("time", LocalTime.of(1, 2))
+                .set("datetime", LocalDateTime.of(2022, 1, 2, 3, 4))
+                .set("timestamp", Instant.ofEpochSecond(123));
+
+        Row row = new Row(schemaDescriptor, new 
ByteBufferRow(marshaller.marshal(tuple).bytes()));
+
+        Tuple tuple1 = deserializeTuple(serializeTuple(TableRow.tuple(row)));
+
+        assertEquals(tuple, tuple1);

Review Comment:
   If someone broke such a test it will obtain noninformative like : 
   `org.opentest4j.AssertionFailedError: 
   Expected :org.apache.ignite.table.TupleImpl@eb5b12c
   Actual   :org.apache.ignite.table.TupleImpl@e2022ac` 



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