{"record":{"id":"62f8d9f5a8e354d2","repo":"t8y2/dbx","slug":"hive-connection-string-must-start-with-jdbc-hive2","errorCode":null,"errorMessage":"Hive connection string must start with jdbc:hive2:// or hive://","messagePattern":"Hive connection string must start with jdbc:hive2:// or hive://","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/config.go","lineNumber":329,"sourceCode":"\t\t}\n\t\tport := defaultHivePort\n\t\tif parsedURL.Port() != \"\" {\n\t\t\tparsedPort, err := strconv.Atoi(parsedURL.Port())\n\t\t\tif err != nil {\n\t\t\t\treturn parsedHiveConnection{}, fmt.Errorf(\"invalid Hive port: %w\", err)\n\t\t\t}\n\t\t\tport = parsedPort\n\t\t}\n\t\tresult.endpoints = []endpoint{{Host: parsedURL.Hostname(), Port: port}}\n\t\tresult.database = strings.Trim(parsedURL.Path, \"/\")\n\t\tfor key, entries := range parsedURL.Query() {\n\t\t\tif len(entries) > 0 {\n\t\t\t\tsetCaseInsensitive(result.parameters, key, entries[len(entries)-1])\n\t\t\t}\n\t\t}\n\t\treturn result, nil\n\t} else {\n\t\treturn parsedHiveConnection{}, errors.New(\"Hive connection string must start with jdbc:hive2:// or hive://\")\n\t}\n\n\tresult := newParsedHiveConnection()\n\tif fragment := strings.IndexByte(value, '#'); fragment >= 0 {\n\t\tresult.hiveVars = parseHiveAssignments(value[fragment+1:], false)\n\t\tvalue = value[:fragment]\n\t}\n\tif query := strings.IndexByte(value, '?'); query >= 0 {\n\t\tresult.hiveConfs = parseHiveAssignments(value[query+1:], false)\n\t\tvalue = value[:query]\n\t}\n\tpathStart := strings.IndexByte(value, '/')\n\tauthority := value\n\tpathAndParams := \"\"\n\tif pathStart >= 0 {\n\t\tauthority = value[:pathStart]\n\t\tpathAndParams = value[pathStart+1:]\n\t}","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/config.go#L311-L347","documentation":"parseHiveConnection only accepts connection strings beginning with the jdbc:hive2:// or hive:// scheme. Any other prefix causes this error. The scheme check is the driver's first validation gate before parsing hosts, parameters, and hive vars.","triggerScenarios":"Passing a connection string with a wrong scheme (e.g. 'jdbc:hive://', 'hive2://', 'http://', or a bare hostname) to the driver's connection-string parser.","commonSituations":"Copy-pasting a URL from another driver (Spark/Impala docs); omitting the scheme entirely; mixing up hive2 vs hive:// spelling; trimming code accidentally removing the prefix.","solutions":["Prefix the string with jdbc:hive2:// (or hive://), e.g. jdbc:hive2://host:10000/default","Fix typos in the scheme (hive2:// or jdbc:hive are not accepted)","Validate the connection-string format before passing it to the driver"],"exampleFix":"// before\ncfg, err := Open(\"hive2://host:10000\")\n// after\ncfg, err := Open(\"jdbc:hive2://host:10000\")","handlingStrategy":"validation","validationCode":"func validHiveConnString(s string) bool {\n    return strings.HasPrefix(s, \"jdbc:hive2://\") || strings.HasPrefix(s, \"hive://\")\n}","typeGuard":null,"tryCatchPattern":"parsed, err := parseHiveConnection(value)\nif err != nil {\n    return fmt.Errorf(\"bad connection string %q: %w\", value, err)\n}","preventionTips":["Centralize connection-string construction in one helper that adds the scheme","Lint/config-check connection strings for the jdbc:hive2:// or hive:// prefix","Don't strip the scheme when copying strings between configs"],"tags":["go","hive","connection-string","validation"],"backgroundTag":"invalid-connection-string","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}