Hisoka-X commented on code in PR #6453:
URL: https://github.com/apache/seatunnel/pull/6453#discussion_r1524179853
##########
seatunnel-api/src/test/java/org/apache/seatunnel/api/table/type/SeaTunnelRowTest.java:
##########
@@ -104,4 +104,23 @@ void testWithMapInterface() {
SeaTunnelRow row = new SeaTunnelRow(new Object[] {map});
Assertions.assertEquals(8, row.getBytesSize());
}
+
+ @Test
+ void testArrayEmptyElement() {
+ String[] stringElements = {"key", null, "value"};
+ SeaTunnelRow stringRow = new SeaTunnelRow(new Object[]
{stringElements});
+ Assertions.assertEquals(8, stringRow.getBytesSize());
+
+ Double[] doubleElements = {null, 10.0, 12.0};
+ SeaTunnelRow doubleRow = new SeaTunnelRow(new Object[]
{doubleElements});
+ Assertions.assertEquals(16, doubleRow.getBytesSize());
+
+ String str = "seatunnel";
+ SeaTunnelRow strRow = new SeaTunnelRow(new Object[] {str});
+ Assertions.assertEquals(9, strRow.getBytesSize());
+
+ String nonStr = null;
+ SeaTunnelRow nonStrRow = new SeaTunnelRow(new Object[] {nonStr});
+ Assertions.assertEquals(0, nonStrRow.getBytesSize());
+ }
Review Comment:
Please add test case to cover `Long[]`, `Double[]`,`String[]` etc. All array
type.
--
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]