Immutable solution version
TiDB: ERROR 1105 vectors have different dimensions
Complete solution
the two vectors in VEC_L2_DISTANCE, VEC_COSINE_DISTANCE, and the other vector functions must have the same dimension, otherwise an error is returned, for example ERROR 1105 (HY000): vectors have different dimensions.
[TiDB docs]: the two vectors in VECL2DISTANCE, VECCOSINEDISTANCE, and the other vector functions must have the same dimension, otherwise an error is returned, for example ERROR 1105 (HY000): vectors have different dimensions. Convert strings with VECFROMTEXT or CAST(... AS VECTOR); TiDB performs an implicit cast when a format-compliant string is passed to a vector-only function. Use VEC_DIMS to check a vector's dimension before combining operands from different sources.
Context: Vector functions require both operands to have the same dimension. A mismatch is a hard error, not a silent cast.
Evidence
Source: Vector functions require both operands to have the same dimension. A mismatch is a hard error, not a silent cast.
Verified resolution: [TiDB docs]: the two vectors in VECL2DISTANCE, VECCOSINEDISTANCE, and the other vector functions must have the same dimension, otherwise an error is returned, for example ERROR 1105 (HY000): vectors have different dimensions. Convert strings with VECFROMTEXT or CAST(... AS VECTOR); TiDB performs an implicit cast when a format-compliant string is passed to a vector-only function. Use VEC_DIMS to check a vector's dimension before combining operands from different sources.
Source URL: https://docs-archive.pingcap.com/tidb/v8.4/vector-search-data-types/
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_9Q_h7Vzib2EtsGVVVRUNIw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">TiDB: ERROR 1105 vectors have different dimensions <span>— Vectle</span></a>