{"record":{"id":"313535e12fb63e3c","repo":"cocoindex-io/cocoindex","slug":"invalid-table-name-format-table","errorCode":null,"errorMessage":"Invalid table name format: {table}","messagePattern":"Invalid table name format: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"python/cocoindex/connectors/doris/_target.py","lineNumber":1404,"sourceCode":"    table: str,\n    vector_field: str,\n    query_vector: list[float],\n    metric: str = \"l2_distance\",\n    limit: int = 10,\n    select_columns: list[str] | None = None,\n    where_clause: str | None = None,\n) -> str:\n    \"\"\"Build a vector search query for Doris.\"\"\"\n    table_parts = table.split(\".\")\n    if len(table_parts) == 2:\n        _validate_identifier(table_parts[0])\n        _validate_identifier(table_parts[1])\n        quoted_table = f\"`{table_parts[0]}`.`{table_parts[1]}`\"\n    elif len(table_parts) == 1:\n        _validate_identifier(table)\n        quoted_table = f\"`{table}`\"\n    else:\n        raise ValueError(f\"Invalid table name format: {table}\")\n\n    _validate_identifier(vector_field)\n\n    if metric == \"l2_distance\":\n        distance_fn = \"l2_distance_approximate\"\n        order = \"ASC\"\n    elif metric == \"inner_product\":\n        distance_fn = \"inner_product_approximate\"\n        order = \"DESC\"\n    else:\n        if not metric.isidentifier():\n            raise ValueError(f\"Invalid metric name: {metric}\")\n        distance_fn = metric\n        order = \"ASC\" if \"distance\" in metric else \"DESC\"\n\n    vector_literal = \"[\" + \", \".join(str(float(v)) for v in query_vector) + \"]\"\n\n    if select_columns:","sourceCodeStart":1386,"sourceCodeEnd":1422,"githubUrl":"https://github.com/cocoindex-io/cocoindex/blob/e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b/python/cocoindex/connectors/doris/_target.py#L1386-L1422","documentation":"build_vector_search_query accepts a table name of 'db.table' (2 parts) or a bare table (1 part). Any other number of dot-separated parts (e.g. '' or 'a.b.c') is rejected with ValueError since it cannot be safely quoted as `db`.`table`.","triggerScenarios":"Passing a fully-qualified name with catalog prefix like 'internal.db.table' (3 parts), an empty string, or a name with stray dots to build_vector_search_query(table=...).","commonSituations":"Doris 2.x+ multi-catalog setups where users copy the catalog-qualified name; trailing/leading dots from string formatting; accidentally passing a connection string fragment.","solutions":["Pass either 'db.table' or plain 'table' — drop the catalog prefix and set the catalog context separately","Strip extra qualification before calling: use only database and table parts","Validate/split the table name before calling the builder"],"exampleFix":"// before\nbuild_vector_search_query(table=\"internal.db.docs\", ...)\n// after\nbuild_vector_search_query(table=\"db.docs\", ...)","handlingStrategy":"validation","validationCode":"parts = table.split(\".\")\nassert len(parts) in (1, 2), f\"table must be 'table' or 'db.table': {table}\"","typeGuard":null,"tryCatchPattern":"try:\n    sql = build_vector_search_query(table=table, ...)\nexcept ValueError as e:\n    logger.error(\"Bad table name: %s\", e); raise","preventionTips":["Strip catalog prefixes; qualify with at most db.table","Validate table name shape before building queries","Avoid building names via string concatenation that can inject extra dots"],"tags":["doris","sql","vector-search","argument-format"],"backgroundTag":"invalid-argument-format","analyzedSha":"e84aa99b3292c5270a4b313b2a7137ad9ce8ab3b","analyzedAt":"2026-09-08T15:59:19.997Z","contentChangedAt":"2026-09-08T15:59:19.997Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}