private @Nullable RelDataType deriveDecimalType(
      RelDataTypeFactory typeFactory,
      RelDataType type1,
      RelDataType type2,
      QuadFunction<Integer, Integer, Integer, Integer, DecimalType> deriveImpl) {
    return deriveDecimalRelDataType(
        typeFactory,
        type1,
        type2,
        (p1, s1, p2, s2) -> {
          DecimalType result = deriveImpl.apply(p1, s1, p2, s2);
          return typeFactory.createSqlType(DECIMAL, result.getPrecision(), result.getScale());
        });
  }
Use derivation from {@link LogicalTypeMerging} to derive decimal type.
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/planner/calcite/FlinkTypeSystem.java