From 4f90d307e3c322fa1c32fb9a7295ba9fb8059004 Mon Sep 17 00:00:00 2001 From: wudi <676366545@qq.com> Date: Thu, 25 Jul 2024 17:32:25 +0800 Subject: [PATCH] update --- .../apache/doris/flink/serialization/RowBatch.java | 8 ++++---- .../doris/flink/serialization/TestRowBatch.java | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) 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);