{"record":{"id":"7c717d4b5951b73f","repo":"risingwavelabs/risingwave","slug":"http-sink-url-column-must-be-varchar-got","errorCode":null,"errorMessage":"HTTP sink url column must be varchar, got {:?}","messagePattern":"HTTP sink url column must be varchar, got (.+?)","errorType":"validation","errorClass":"SinkError::Config","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/http.rs","lineNumber":175,"sourceCode":"        let url_index = fields\n            .iter()\n            .position(|field| field.name == HTTP_SINK_URL_COLUMN);\n        let url = match (url, url_index) {\n            (Some(_), Some(_)) => {\n                return Err(SinkError::Config(anyhow!(\n                    \"HTTP sink url option cannot coexist with url column\"\n                )));\n            }\n            (Some(url), None) => {\n                let url = url\n                    .parse()\n                    .context(\"invalid URL\")\n                    .map_err(SinkError::Config)?;\n                HttpUrl::Static(url)\n            }\n            (None, Some(url_index)) => {\n                if fields[url_index].data_type != DataType::Varchar {\n                    return Err(SinkError::Config(anyhow!(\n                        \"HTTP sink url column must be varchar, got {:?}\",\n                        fields[url_index].data_type\n                    )));\n                }\n                HttpUrl::Dynamic { url_index }\n            }\n            (None, None) => {\n                return Err(SinkError::Config(anyhow!(\n                    \"HTTP sink requires either url option or url column\"\n                )));\n            }\n        };\n\n        (payload_index, url, fields[payload_index].data_type.clone())\n    };\n\n    if payload_type != DataType::Varchar && payload_type != DataType::Jsonb {\n        return Err(SinkError::Config(anyhow!(","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/http.rs#L157-L193","documentation":"When the HTTP sink is configured with a dynamic `url` column (no static `url` option), that column's data type must be VARCHAR since it holds a URL string per row. `validate_http_sink` rejects the sink if the column exists but has any other type.","triggerScenarios":"Creating an HTTP sink whose schema contains a `url` column typed as something other than VARCHAR (e.g. JSONB, INT, BYTEA); detected in `try_from` -> `validate_http_sink` at the `(None, Some(url_index))` arm.","commonSituations":"Table column typed as JSONB or struct holding endpoint metadata; users assuming the sink will cast/serialize the column automatically.","solutions":["Alter the source/table so the `url` column is VARCHAR","Cast the column when defining the sink query: SELECT url::VARCHAR AS url, ... ","Remove the non-varchar `url` column and supply a static `url` option instead"],"exampleFix":"// before\nSELECT url::JSONB AS url, payload FROM t; -- sink schema\n// after\nSELECT url::VARCHAR AS url, payload FROM t;","handlingStrategy":"validation","validationCode":"if let Some(f) = fields.iter().find(|f| f.name == \"url\") {\n    assert!(f.data_type == DataType::Varchar, \"url column must be VARCHAR, got {:?}\", f.data_type);\n}","typeGuard":"fn is_varchar(f: &Field) -> bool { f.data_type == DataType::Varchar }","tryCatchPattern":null,"preventionTips":["Keep the url column VARCHAR in the source table","Cast non-string url columns in the sink SELECT query"],"tags":["sink","http","type-mismatch","risingwave"],"backgroundTag":"type-mismatch","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}