Remove subset dotProduct from tuple-functions and add dotProduct as an alias to the superset

This commit is contained in:
Blargian 2024-04-10 17:09:01 +02:00
parent f426b5f12b
commit 4408714c55
2 changed files with 1 additions and 40 deletions

View File

@ -784,7 +784,7 @@ Returns the dot product of two arrays.
arrayDotProduct(vector1, vector2)
```
Alias: `scalarProduct`
Alias: `scalarProduct`, `dotProduct`
**Parameters**

View File

@ -521,45 +521,6 @@ Result:
└──────────────────────────────────┘
```
## dotProduct
Calculates the scalar product of two tuples of the same size.
**Syntax**
```sql
dotProduct(tuple1, tuple2)
```
Alias: `scalarProduct`.
**Arguments**
- `tuple1` — First tuple. [Tuple](../../sql-reference/data-types/tuple.md).
- `tuple2` — Second tuple. [Tuple](../../sql-reference/data-types/tuple.md).
**Returned value**
- Scalar product.
Type: [Int/UInt](../../sql-reference/data-types/int-uint.md) or [Float](../../sql-reference/data-types/float.md).
**Example**
Query:
```sql
SELECT dotProduct((1, 2), (2, 3));
```
Result:
```text
┌─dotProduct((1, 2), (2, 3))─┐
│ 8 │
└────────────────────────────┘
```
## tupleConcat
Combines tuples passed as arguments.