{"record":{"id":"337ba89163e9859b","repo":"apache/beam","slug":"wrong-jdbc-type-expected-but-got-overriding-with-337ba8","errorCode":null,"errorMessage":"Wrong JDBC type. Expected '{}' but got '{}'. Overriding with '{}'.","messagePattern":"Wrong JDBC type\\. Expected '(.+?)' but got '(.+?)'\\. Overriding with '(.+?)'\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/providers/ReadFromSqlServerSchemaTransformProvider.java","lineNumber":62,"sourceCode":"    return getUrn(ExternalTransforms.ManagedTransforms.Urns.SQL_SERVER_READ);\n  }\n\n  @Override\n  public String description() {\n    return inheritedDescription(\"SQL Server\", \"ReadFromSqlServer\", \"sqlserver\", 1433);\n  }\n\n  @Override\n  protected String jdbcType() {\n    return MSSQL;\n  }\n\n  @Override\n  public @UnknownKeyFor @NonNull @Initialized SchemaTransform from(\n      JdbcReadSchemaTransformConfiguration configuration) {\n    String jdbcType = configuration.getJdbcType();\n    if (jdbcType != null && !jdbcType.isEmpty() && !jdbcType.equals(jdbcType())) {\n      LOG.warn(\n          \"Wrong JDBC type. Expected '{}' but got '{}'. Overriding with '{}'.\",\n          jdbcType(),\n          jdbcType,\n          jdbcType());\n      configuration = configuration.toBuilder().setJdbcType(jdbcType()).build();\n    }\n\n    List<@org.checkerframework.checker.nullness.qual.Nullable String> connectionInitSql =\n        configuration.getConnectionInitSql();\n    if (connectionInitSql != null && !connectionInitSql.isEmpty()) {\n      throw new IllegalArgumentException(\"SQL Server does not support connectionInitSql.\");\n    }\n\n    // Override \"connectionInitSql\" for sqlserver\n    configuration = configuration.toBuilder().setConnectionInitSql(Collections.emptyList()).build();\n    return new SqlServerReadSchemaTransform(configuration);\n  }\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/providers/ReadFromSqlServerSchemaTransformProvider.java#L44-L80","documentation":"Warning logged by the SQL Server read SchemaTransform provider when the configuration's jdbcType does not match the provider's jdbcType(). The value is overridden with the provider's own type and execution continues against SQL Server. It signals a mismatched database configuration.","triggerScenarios":"Passing a JdbcReadSchemaTransformConfiguration with a non-empty jdbcType differing from the SQL Server provider's jdbcType() into ReadFromSqlServerSchemaTransformProvider.from().","commonSituations":"Reusing a config object created for Postgres or MySQL for a SQL Server read, or templating pipelines where jdbcType is set from a generic variable.","solutions":["Clear the jdbcType field from the configuration so the provider default applies.","Set jdbcType to the SQL Server provider's jdbcType() value.","Use the correct provider (e.g. ReadFromPostgresSchemaTransformProvider) if SQL Server is not the real target.","Confirm the URL and driver in the configuration also match SQL Server."],"exampleFix":"// before\nJdbcReadSchemaTransformConfiguration cfg = JdbcReadSchemaTransformConfiguration.builder()\n    .setJdbcType(\"postgres\")\n    .setUrl(\"jdbc:sqlserver://host;databaseName=db\")\n    .build();\n// after\nJdbcReadSchemaTransformConfiguration cfg = JdbcReadSchemaTransformConfiguration.builder()\n    .setUrl(\"jdbc:sqlserver://host;databaseName=db\")\n    .build();","handlingStrategy":"validation","validationCode":"if (config.getJdbcType() != null && !config.getJdbcType().isEmpty()\n    && !\"sqlserver\".equalsIgnoreCase(config.getJdbcType())) {\n  throw new IllegalArgumentException(\"jdbcType must match the SQL Server provider\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit jdbcType when using the SQL Server provider.","Keep one config builder per database.","Assert jdbcType consistency in pipeline unit tests."],"tags":["jdbc","sqlserver","configuration","beam-io"],"backgroundTag":"invalid-config-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}