public static SqlDecimal toSqlDecimal(final SqlType type) {
    switch (type.baseType()) {
      case DECIMAL: return (SqlDecimal) type;
      case INTEGER: return SqlTypes.INT_UPCAST_TO_DECIMAL;
      case BIGINT:  return SqlTypes.BIGINT_UPCAST_TO_DECIMAL;
      default:
        throw new KsqlException(
            "Cannot convert " + type.baseType() + " to " + SqlBaseType.DECIMAL + ".");
    }
  }
@Test
  public void shouldConvertDecimalToSqlDecimal() {
    // Given:
    final SqlDecimal given = SqlTypes.decimal(2, 2);

    // When:
    final SqlDecimal decimal = DecimalUtil.toSqlDecimal(given);

    // Then:
    assertThat(decimal, is(SqlTypes.decimal(2, 2)));
  }