Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sdks/java/expansion-service/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ WORKDIR /opt/apache/beam
COPY target/avro.jar jars/
COPY target/beam-sdks-java-io-expansion-service.jar jars/
COPY target/beam-sdks-java-io-google-cloud-platform-expansion-service.jar jars/
COPY target/beam-sdks-java-extensions-schemaio-expansion-service.jar jars/

# Copy licenses
COPY target/LICENSE /opt/apache/beam/
Expand Down
6 changes: 6 additions & 0 deletions sdks/java/extensions/schemaio-expansion-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ task runExpansionService (type: JavaExec) {
classpath = sourceSets.test.runtimeClasspath
args = [project.findProperty("constructionService.port") ?: "8097"]
}

shadowJar {
manifest {
attributes(["Multi-Release": true])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ protected String jdbcType() {
JdbcReadSchemaTransformConfiguration configuration) {
String jdbcType = configuration.getJdbcType();
if (jdbcType != null && !jdbcType.isEmpty() && !jdbcType.equals(jdbcType())) {
throw new IllegalArgumentException(
String.format("Wrong JDBC type. Expected '%s' but got '%s'", jdbcType(), jdbcType));
LOG.warn(
"Wrong JDBC type. Expected '{}' but got '{}'. Overriding with '{}'.",
jdbcType(),
jdbcType,
jdbcType());
configuration = configuration.toBuilder().setJdbcType(jdbcType()).build();
}

List<@org.checkerframework.checker.nullness.qual.Nullable String> connectionInitSql =
configuration.getConnectionInitSql();
if (connectionInitSql != null && !connectionInitSql.isEmpty()) {
LOG.warn("Postgres does not support connectionInitSql, ignoring.");
throw new IllegalArgumentException("Postgres does not support connectionInitSql.");
}

Boolean disableAutoCommit = configuration.getDisableAutoCommit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ protected String jdbcType() {
JdbcWriteSchemaTransformConfiguration configuration) {
String jdbcType = configuration.getJdbcType();
if (jdbcType != null && !jdbcType.isEmpty() && !jdbcType.equals(jdbcType())) {
throw new IllegalArgumentException(
String.format("Wrong JDBC type. Expected '%s' but got '%s'", jdbcType(), jdbcType));
LOG.warn(
"Wrong JDBC type. Expected '{}' but got '{}'. Overriding with '{}'.",
jdbcType(),
jdbcType,
jdbcType());
configuration = configuration.toBuilder().setJdbcType(jdbcType()).build();
}

List<@org.checkerframework.checker.nullness.qual.Nullable String> connectionInitSql =
configuration.getConnectionInitSql();
if (connectionInitSql != null && !connectionInitSql.isEmpty()) {
LOG.warn("Postgres does not support connectionInitSql, ignoring.");
throw new IllegalArgumentException("Postgres does not support connectionInitSql.");
}

// Override "connectionInitSql" for postgres
Expand Down
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/transforms/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
ManagedTransforms.Urns.POSTGRES_WRITE.urn: _GCP_EXPANSION_SERVICE_JAR_TARGET, # pylint: disable=line-too-long
ManagedTransforms.Urns.MYSQL_READ.urn: _GCP_EXPANSION_SERVICE_JAR_TARGET,
ManagedTransforms.Urns.MYSQL_WRITE.urn: _GCP_EXPANSION_SERVICE_JAR_TARGET,
ManagedTransforms.Urns.SQL_SERVER_READ.urn: _GCP_EXPANSION_SERVICE_JAR_TARGET, # pylint: disable=line-too-long
ManagedTransforms.Urns.SQL_SERVER_WRITE.urn: _GCP_EXPANSION_SERVICE_JAR_TARGET, # pylint: disable=line-too-long
}


Expand Down
Loading