{"record":{"id":"bab5df07362cfa34","repo":"apache/shardingsphere","slug":"unsupported-data-source-type-s","errorCode":null,"errorMessage":"Unsupported data source type `%s`","messagePattern":"Unsupported data source type `(.+?)`","errorType":"exception","errorClass":"UnsupportedSQLOperationException","httpStatus":null,"severity":"error","filePath":"kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/config/PipelineDataSourceConfigurationFactory.java","lineNumber":48,"sourceCode":"@NoArgsConstructor(access = AccessLevel.PRIVATE)\npublic final class PipelineDataSourceConfigurationFactory {\n    \n    /**\n     * Create new instance of pipeline data source configuration.\n     *\n     * @param type type of pipeline data source configuration\n     * @param param parameter of pipeline data source configuration\n     * @return created instance\n     * @throws UnsupportedSQLOperationException unsupported SQL operation exception\n     */\n    public static PipelineDataSourceConfiguration newInstance(final String type, final String param) {\n        switch (type) {\n            case StandardPipelineDataSourceConfiguration.TYPE:\n                return new StandardPipelineDataSourceConfiguration(param);\n            case ShardingSpherePipelineDataSourceConfiguration.TYPE:\n                return new ShardingSpherePipelineDataSourceConfiguration(param);\n            default:\n                throw new UnsupportedSQLOperationException(String.format(\"Unsupported data source type `%s`\", type));\n        }\n    }\n}\n","sourceCodeStart":30,"sourceCodeEnd":52,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/datasource/config/PipelineDataSourceConfigurationFactory.java#L30-L52","documentation":"PipelineDataSourceConfigurationFactory.newInstance(type, param) is a string-keyed factory supporting only StandardPipelineDataSourceConfiguration.TYPE and ShardingSpherePipelineDataSourceConfiguration.TYPE. Any other type string falls through the switch to UnsupportedSQLOperationException('Unsupported data source type `type`'). It is typically invoked when parsing the dataSourceConfig of a migration/scaling job.","triggerScenarios":"Submitting a MIGGL/distsql job (or building a pipeline job config programmatically) whose dataSourceConfig type field is something like 'MySQL', 'Jdbc', 'sharding', or an empty/garbage string instead of one of the two supported TYPE constants.","commonSituations":"Hand-writing distsql MIGRATE DATABASE rules and guessing the type name; JSON/YAML key drift after a ShardingSphere upgrade renamed or consolidated types; frontend/UI emitting the wrong type tag; trailing whitespace or wrong case in the type string.","solutions":["Use the exact factory-recognized type constants: the value of StandardPipelineDataSourceConfiguration.TYPE for plain JDBC URLs, or ShardingSpherePipelineDataSourceConfiguration.TYPE for proxied data sources.","Inspect the constant values in your ShardingSphere version (they can change between releases) rather than relying on memory.","Trim and validate the type string before job submission; treat anything outside the two constants as a configuration error."],"exampleFix":"// before\nPipelineDataSourceConfiguration cfg = PipelineDataSourceConfigurationFactory.newInstance(\"MySQL\", url);\n\n// after\nPipelineDataSourceConfiguration cfg = PipelineDataSourceConfigurationFactory.newInstance(StandardPipelineDataSourceConfiguration.TYPE, url);","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(StandardPipelineDataSourceConfiguration.TYPE, ShardingSpherePipelineDataSourceConfiguration.TYPE);\nif (!supported.contains(type)) {\n    throw new IllegalArgumentException(\"dataSourceConfig type must be one of \" + supported + \", got: \" + type);\n}","typeGuard":null,"tryCatchPattern":"try {\n    PipelineDataSourceConfiguration cfg = PipelineDataSourceConfigurationFactory.newInstance(type, param);\n} catch (final UnsupportedSQLOperationException ex) {\n    // fix the type field in the job's dataSourceConfig and resubmit\n}","preventionTips":["Reference the TYPE constants programmatically instead of hard-coding type strings.","Build dataSourceConfig JSON via a helper that only emits supported types.","Check the factory's switch (or its Javadoc) in your ShardingSphere version when authoring distsql by hand."],"tags":["pipeline","data-source","factory","configuration"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}