{"record":{"id":"137ce7f82d76fc00","repo":"apache/dolphinscheduler","slug":"aliyun-serverless-spark-adhocdatasourceclient-is-n","errorCode":null,"errorMessage":"Aliyun Serverless Spark AdHocDataSourceClient is not supported","messagePattern":"Aliyun Serverless Spark AdHocDataSourceClient is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-aliyunserverlessspark/src/main/java/org/apache/dolphinscheduler/plugin/datasource/aliyunserverlessspark/AliyunServerlessSparkDataSourceChannel.java","lineNumber":30,"sourceCode":" * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.dolphinscheduler.plugin.datasource.aliyunserverlessspark;\n\nimport org.apache.dolphinscheduler.spi.datasource.AdHocDataSourceClient;\nimport org.apache.dolphinscheduler.spi.datasource.BaseConnectionParam;\nimport org.apache.dolphinscheduler.spi.datasource.DataSourceChannel;\nimport org.apache.dolphinscheduler.spi.datasource.PooledDataSourceClient;\nimport org.apache.dolphinscheduler.spi.enums.DbType;\n\npublic class AliyunServerlessSparkDataSourceChannel implements DataSourceChannel {\n\n    @Override\n    public AdHocDataSourceClient createAdHocDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {\n        throw new UnsupportedOperationException(\"Aliyun Serverless Spark AdHocDataSourceClient is not supported\");\n    }\n\n    @Override\n    public PooledDataSourceClient createPooledDataSourceClient(BaseConnectionParam baseConnectionParam, DbType dbType) {\n        throw new UnsupportedOperationException(\"Aliyun Serverless Spark AdHocDataSourceClient is not supported\");\n    }\n}\n","sourceCodeStart":12,"sourceCodeEnd":38,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-aliyunserverlessspark/src/main/java/org/apache/dolphinscheduler/plugin/datasource/aliyunserverlessspark/AliyunServerlessSparkDataSourceChannel.java#L12-L38","documentation":"The Aliyun Serverless Spark datasource plugin only implements pooled data source clients. Its DataSourceChannel.createAdHocDataSourceClient is a stub that unconditionally throws UnsupportedOperationException, because ad-hoc (per-query) connections are not implemented for this database type.","triggerScenarios":"Requesting an ad-hoc (SQL execute-once) client for an Aliyun Serverless Spark datasource — e.g. via the ad-hoc query / SQL execution API paths that call DataSourceClientFactory/adhoc client creation for this DbType.","commonSituations":"Trying to run ad-hoc SQL queries against an Aliyun Serverless Spark connection in the UI/API; plugin support added for pooled usage only, with ad-hoc paths never implemented.","solutions":["Use the pooled data source client path (createPooledDataSourceClient) for this plugin.","Choose a datasource type that supports ad-hoc clients if ad-hoc execution is required.","Check the plugin version / upstream DolphinScheduler for added ad-hoc support before relying on it."],"exampleFix":"// before\nAdHocDataSourceClient client = channel.createAdHocDataSourceClient(param, DbType.ALIYUN_SERVERLESS_SPARK); // throws\n// after\nPooledDataSourceClient client = channel.createPooledDataSourceClient(param, DbType.ALIYUN_SERVERLESS_SPARK);","handlingStrategy":"fallback","validationCode":"if (dbType == DbType.ALIYUN_SERVERLESS_SPARK) {\n    // ad-hoc client unsupported; use pooled client path\n}","typeGuard":"boolean supportsAdHoc(DbType t) { return t != DbType.ALIYUN_SERVERLESS_SPARK; }","tryCatchPattern":"try {\n    client = channel.createAdHocDataSourceClient(param, dbType);\n} catch (UnsupportedOperationException e) {\n    client = channel.createPooledDataSourceClient(param, dbType);\n}","preventionTips":["Check plugin capability before requesting an ad-hoc client.","Route Aliyun Serverless Spark workloads through the pooled client.","Pin to a plugin version known to support your execution mode."],"tags":["unsupported-operation","datasource-plugin","aliyun-serverless-spark"],"backgroundTag":"unsupported-operation","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}