diff --git a/flink-cdc-common/src/main/java/org/apache/flink/cdc/common/utils/SchemaMergingUtils.java b/flink-cdc-common/src/main/java/org/apache/flink/cdc/common/utils/SchemaMergingUtils.java index 173aeb42dcd..dd93d5ca330 100644 --- a/flink-cdc-common/src/main/java/org/apache/flink/cdc/common/utils/SchemaMergingUtils.java +++ b/flink-cdc-common/src/main/java/org/apache/flink/cdc/common/utils/SchemaMergingUtils.java @@ -810,7 +810,9 @@ private static Map, List> getTypeMergingTree mergingTree.put(DoubleType.class, ImmutableList.of(doubleType, stringType)); mergingTree.put(FloatType.class, ImmutableList.of(floatType, doubleType, stringType)); mergingTree.put(DecimalType.class, ImmutableList.of(stringType)); - mergingTree.put(BigIntType.class, ImmutableList.of(bigIntType, decimalType, stringType)); + mergingTree.put( + BigIntType.class, + ImmutableList.of(bigIntType, decimalType, doubleType, stringType)); mergingTree.put( IntType.class, ImmutableList.of(intType, bigIntType, decimalType, doubleType, stringType)); diff --git a/flink-cdc-common/src/test/java/org/apache/flink/cdc/common/utils/SchemaMergingUtilsTest.java b/flink-cdc-common/src/test/java/org/apache/flink/cdc/common/utils/SchemaMergingUtilsTest.java index 5710206f066..c5021d59350 100644 --- a/flink-cdc-common/src/test/java/org/apache/flink/cdc/common/utils/SchemaMergingUtilsTest.java +++ b/flink-cdc-common/src/test/java/org/apache/flink/cdc/common/utils/SchemaMergingUtilsTest.java @@ -975,7 +975,7 @@ void testGetLeastCommonType() { DECIMAL, FLOAT, DOUBLE, STRING, STRING, STRING, STRING, STRING, STRING, STRING)); - // 16-bit TINYINT could fit into FLOAT (24 sig bits) or DOUBLE (53 sig bits) + // 16-bit SMALLINT could fit into FLOAT (24 sig bits) or DOUBLE (53 sig bits) assertTypeMergingVector( SMALLINT, Arrays.asList( @@ -983,7 +983,7 @@ void testGetLeastCommonType() { DECIMAL, FLOAT, DOUBLE, STRING, STRING, STRING, STRING, STRING, STRING, STRING)); - // 32-bit TINYINT could fit into DOUBLE (53 sig bits) + // 32-bit INT could fit into DOUBLE (53 sig bits) assertTypeMergingVector( INT, Arrays.asList( @@ -994,7 +994,7 @@ void testGetLeastCommonType() { BIGINT, Arrays.asList( STRING, STRING, STRING, STRING, STRING, BIGINT, BIGINT, BIGINT, BIGINT, - DECIMAL, STRING, STRING, STRING, STRING, STRING, STRING, STRING, STRING, + DECIMAL, DOUBLE, DOUBLE, STRING, STRING, STRING, STRING, STRING, STRING, STRING)); assertTypeMergingVector( @@ -1007,14 +1007,14 @@ void testGetLeastCommonType() { assertTypeMergingVector( FLOAT, Arrays.asList( - STRING, STRING, STRING, STRING, STRING, FLOAT, FLOAT, DOUBLE, STRING, + STRING, STRING, STRING, STRING, STRING, FLOAT, FLOAT, DOUBLE, DOUBLE, STRING, FLOAT, DOUBLE, STRING, STRING, STRING, STRING, STRING, STRING, STRING)); assertTypeMergingVector( DOUBLE, Arrays.asList( - STRING, STRING, STRING, STRING, STRING, DOUBLE, DOUBLE, DOUBLE, STRING, + STRING, STRING, STRING, STRING, STRING, DOUBLE, DOUBLE, DOUBLE, DOUBLE, STRING, DOUBLE, DOUBLE, STRING, STRING, STRING, STRING, STRING, STRING, STRING));