diff --git a/flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java b/flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java index dd49120f7..38c63b779 100644 --- a/flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java +++ b/flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java @@ -348,9 +348,9 @@ public boolean doConvert( addValueToRow(rowIndex, dateTime); } else { logger.error( - "Unsupported type for DATETIME, minorType {}, vector {}", + "Unsupported type for DATETIME, minorType {}, class is {}", minorType.name(), - fieldVector); + fieldVector == null ? null : fieldVector.getClass()); return false; } break; @@ -370,9 +370,9 @@ public boolean doConvert( addValueToRow(rowIndex, dateTime); } else { logger.error( - "Unsupported type for DATETIMEV2, minorType {}, vector {}", + "Unsupported type for DATETIMEV2, minorType {}, class is {}", minorType.name(), - fieldVector); + fieldVector == null ? null : fieldVector.getClass()); return false; } break; diff --git a/flink-doris-connector/src/test/java/org/apache/doris/flink/serialization/TestRowBatch.java b/flink-doris-connector/src/test/java/org/apache/doris/flink/serialization/TestRowBatch.java index 8a552a7e3..3d9ac2617 100644 --- a/flink-doris-connector/src/test/java/org/apache/doris/flink/serialization/TestRowBatch.java +++ b/flink-doris-connector/src/test/java/org/apache/doris/flink/serialization/TestRowBatch.java @@ -1333,12 +1333,23 @@ public void testDoConvert() throws Exception { flag = rowBatch.doConvert(1, 1, Types.MinorType.INT, "DATETIME", null); Assert.assertFalse(flag); + flag = rowBatch.doConvert(1, 1, Types.MinorType.TIMESTAMPSEC, "DATETIME", null); + Assert.assertFalse(flag); + + IntVector intVector1 = new IntVector("test", new RootAllocator(Integer.MAX_VALUE)); + intVector1.setNull(0); + flag = rowBatch.doConvert(1, 1, Types.MinorType.TIMESTAMPSEC, "DATETIME", intVector1); + Assert.assertFalse(flag); + flag = rowBatch.doConvert(1, 1, Types.MinorType.INT, "DATETIMEV2", null); Assert.assertFalse(flag); flag = rowBatch.doConvert(1, 1, Types.MinorType.TIMESTAMPSEC, "DATETIMEV2", null); Assert.assertFalse(flag); + flag = rowBatch.doConvert(1, 1, Types.MinorType.TIMESTAMPSEC, "DATETIMEV2", intVector1); + Assert.assertFalse(flag); + flag = rowBatch.doConvert(1, 1, Types.MinorType.INT, "LARGEINT", null); Assert.assertFalse(flag);