public static List<FieldInfo> buildSourceSchemaEntity(final LogicalSchema schema) {
    final List<FieldInfo> allFields = schema.columns().stream()
        .map(EntityUtil::toFieldInfo)
        .collect(Collectors.toList());

    if (allFields.isEmpty()) {
      throw new IllegalArgumentException("Root schema should contain columns: " + schema);
    }

    return allFields;
  }
@Test
  public void shouldBuildCorrectDecimalField() {
    // Given:
    final SqlDecimal decimal  = SqlTypes.decimal(10, 9);
    final LogicalSchema schema = LogicalSchema.builder()
            .valueColumn(ColumnName.of("field"), decimal)
            .build();

    // When:
    final List<FieldInfo> fields = EntityUtil.buildSourceSchemaEntity(schema);

    // Then:
    assertThat(fields, hasSize(1));
    assertThat(fields.get(0).getName(), equalTo("field"));
    assertThat(fields.get(0).getSchema().getTypeName(), equalTo("DECIMAL"));
    assertThat(fields.get(0).getSchema().getFields(), equalTo(Optional.empty()));
    assertThat(fields.get(0).getSchema().getParameters().get(SqlDecimal.SCALE), equalTo(decimal.getScale()));
    assertThat(fields.get(0).getSchema().getParameters().get(SqlDecimal.PRECISION), equalTo(decimal.getPrecision()));
  }