{"record":{"id":"b2e865969f0e988b","repo":"apache/seatunnel","slug":"commonerrorcode-unsupported-method","errorCode":"CommonErrorCode.UNSUPPORTED_METHOD","errorMessage":"unsupported query type","messagePattern":"unsupported query type","errorType":"error_code","errorClass":"PrometheusConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/source/PrometheusSourceReader.java","lineNumber":128,"sourceCode":"                    Thread.sleep(httpParameter.getPollIntervalMillis());\n                }\n            }\n        }\n    }\n\n    private void collect(Collector<SeaTunnelRow> output, String data) throws IOException {\n        if (contentJson != null) {\n            data = JsonUtils.stringToJsonNode(getPartOfJson(data)).toString();\n        }\n        switch (queryType) {\n            case Range:\n                convertRangePoints(data, output);\n                break;\n            case Instant:\n                convertInstantPoints(data, output);\n                break;\n            default:\n                throw new PrometheusConnectorException(\n                        CommonErrorCode.UNSUPPORTED_METHOD, \"unsupported query type\");\n        }\n    }\n\n    private void convertRangePoints(String data, Collector<SeaTunnelRow> output) {\n        List<RangePoint> rangePoints = JsonUtils.toList(data, RangePoint.class);\n        if (CollectionUtils.isEmpty(rangePoints)) {\n            return;\n        }\n        rangePoints.forEach(\n                rangePoint -> {\n                    Map<String, String> metric = rangePoint.getMetric();\n                    rangePoint\n                            .getValues()\n                            .forEach(\n                                    value -> {\n                                        double timestampDouble =\n                                                Double.valueOf(String.valueOf(value.get(0)));","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-prometheus/src/main/java/org/apache/seatunnel/connectors/seatunnel/prometheus/source/PrometheusSourceReader.java#L110-L146","documentation":"PrometheusSourceReader.collect converts query results based on the configured query type (Range or Instant); an unknown QueryType falls through the switch default and throws UNSUPPORTED_METHOD with 'unsupported query type'.","triggerScenarios":"The source's configured query type value resolves to something other than the supported Range/Instant enum values.","commonSituations":"Misspelled query_type in config (e.g. 'range_query' or 'instant_query' instead of Range/Instant); case-sensitivity issues; config from an older connector version with different enum names.","solutions":["Set query_type to a supported value (Range or Instant)","Fix spelling/casing of the query_type config value","Check the connector docs for currently supported query types","Upgrade the connector if your config predates the current enum"],"exampleFix":"// before\nquery_type = \"range_query\"\n// after\nquery_type = \"Range\"","handlingStrategy":"validation","validationCode":"String qt = config.getString(\"query_type\");\nif (!\"Range\".equals(qt) && !\"Instant\".equals(qt)) throw new IllegalArgumentException(\"query_type must be Range or Instant, got: \" + qt);","typeGuard":"boolean isSupportedQueryType(String qt) { return \"Range\".equals(qt) || \"Instant\".equals(qt); }","tryCatchPattern":"try { reader.pollAndCollectData(); } catch (PrometheusConnectorException e) { if (CommonErrorCode.UNSUPPORTED_METHOD.equals(e.getErrorCode())) { LOG.error(\"Invalid query_type config\"); } throw e; }","preventionTips":["Validate query_type against the supported enum at config load time","Copy enum names exactly from connector documentation","Pin connector versions to avoid enum renames between releases"],"tags":["prometheus","source","query-type"],"backgroundTag":"unsupported-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}