NumericIndexedVector

Introduced in: v25.7.0

Performs pointwise multiplication between a numericIndexedVector and either another numericIndexedVector or a numeric constant.

**Syntax**

```
numericIndexedVectorPointwiseMultiply(v1, v2)
```

**Arguments**

- `v1` — [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)
- `v2` — A numeric constant or numericIndexedVector object. [`(U)Int*`](/docs/sql-reference/data-types/int-uint) or [`Float*`](/docs/sql-reference/data-types/float) or [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Returned value**

Returns a new numericIndexedVector object. [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Examples**

---

```
with
    numericIndexedVectorBuild(mapFromArrays([1, 2, 3], arrayMap(x -> toInt32(x), [10, 20, 30]))) as vec1,
    numericIndexedVectorBuild(mapFromArrays([2, 3, 4], arrayMap(x -> toInt32(x), [10, 20, 30]))) as vec2
SELECT
    numericIndexedVectorToMap(numericIndexedVectorPointwiseMultiply(vec1, vec2)) AS res1,
    numericIndexedVectorToMap(numericIndexedVectorPointwiseMultiply(vec1, 2)) AS res2;
```

```
┌─res1──────────┬─res2─────────────┐
│ {2:200,3:600} │ {1:20,2:40,3:60} │
└───────────────┴──────────────────┘
```

## numericIndexedVectorPointwiseNotEqual[​](#numericIndexedVectorPointwiseNotEqual "Direct link to numericIndexedVectorPointwiseNotEqual")

Introduced in: v25.7.0

Performs pointwise comparison between a numericIndexedVector and either another numericIndexedVector or a numeric constant.
The result is a numericIndexedVector containing the indices where the values are not equal, with all corresponding values set to 1.

**Syntax**

```
numericIndexedVectorPointwiseNotEqual(v1, v2)
```

**Arguments**

- `v1` — [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)
- `v2` — A numeric constant or numericIndexedVector object. [`(U)Int*`](/docs/sql-reference/data-types/int-uint) or [`Float*`](/docs/sql-reference/data-types/float) or [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Returned value**

Returns a new numericIndexedVector object. [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Examples**

**Usage example**

```
with
    numericIndexedVectorBuild(mapFromArrays([1, 2, 3], arrayMap(x -> toFloat64(x), [10, 20, 30]))) as vec1,
    numericIndexedVectorBuild(mapFromArrays([2, 3, 4], arrayMap(x -> toFloat64(x), [20, 20, 30]))) as vec2
SELECT
    numericIndexedVectorToMap(numericIndexedVectorPointwiseNotEqual(vec1, vec2)) AS res1,
    numericIndexedVectorToMap(numericIndexedVectorPointwiseNotEqual(vec1, 20)) AS res2;
```

```
┌─res1──────────┬─res2──────┐
│ {1:1,3:1,4:1} │ {1:1,3:1} │
└───────────────┴───────────┘
```

## numericIndexedVectorPointwiseSubtract[​](#numericIndexedVectorPointwiseSubtract "Direct link to numericIndexedVectorPointwiseSubtract")

Introduced in: v25.7.0

Performs pointwise subtraction between a numericIndexedVector and either another numericIndexedVector or a numeric constant.

**Syntax**

```
numericIndexedVectorPointwiseSubtract(v1, v2)
```

**Arguments**

- `v1` — [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)
- `v2` — A numeric constant or numericIndexedVector object. [`(U)Int*`](/docs/sql-reference/data-types/int-uint) or [`Float*`](/docs/sql-reference/data-types/float) or [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Returned value**

Returns a new numericIndexedVector object. [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Examples**

**Usage example**

```
WITH
    numericIndexedVectorBuild(mapFromArrays([1, 2, 3], arrayMap(x -> toInt32(x), [10, 20, 30]))) AS vec1,
    numericIndexedVectorBuild(mapFromArrays([2, 3, 4], arrayMap(x -> toInt32(x), [10, 20, 30]))) AS vec2
SELECT
    numericIndexedVectorToMap(numericIndexedVectorPointwiseSubtract(vec1, vec2)) AS res1,
    numericIndexedVectorToMap(numericIndexedVectorPointwiseSubtract(vec1, 2)) AS res2;
```

```
┌─res1───────────────────┬─res2────────────┐
│ {1:10,2:10,3:10,4:-30} │ {1:8,2:18,3:28} │
└────────────────────────┴─────────────────┘
```

## numericIndexedVectorShortDebugString[​](#numericIndexedVectorShortDebugString "Direct link to numericIndexedVectorShortDebugString")

Introduced in: v25.7.0

Returns internal information of the numericIndexedVector in JSON format.
This function is primarily used for debugging purposes.

**Syntax**

```
numericIndexedVectorShortDebugString(v)
```

**Arguments**

- `v` — [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Returned value**

Returns a JSON string containing debug information. [`String`](/docs/sql-reference/data-types/string)

**Examples**

**Usage example**

```
SELECT numericIndexedVectorShortDebugString(numericIndexedVectorBuild(mapFromArrays([1, 2, 3], [10, 20, 30]))) AS res\G;
```

```
Row 1:
──────
res: {"vector_type":"BSI","index_type":"char8_t","value_type":"char8_t","integer_bit_num":8,"fraction_bit_num":0,"zero_indexes_info":{"cardinality":"0"},"non_zero_indexes_info":{"total_cardinality":"3","all_value_sum":60,"number_of_bitmaps":"8","bitmap_info":{"cardinality":{"0":"0","1":"2","2":"2","3":"2","4":"2","5":"0","6":"0","7":"0"}}}}
```

## numericIndexedVectorToMap[​](#numericIndexedVectorToMap "Direct link to numericIndexedVectorToMap")

Introduced in: v25.7.0

Converts a numericIndexedVector to a map.

**Syntax**

```
numericIndexedVectorToMap(v)
```

**Arguments**

- `v` — [`numericIndexedVector`](/docs/sql-reference/functions/numeric-indexed-vector-functions#create-numeric-indexed-vector-object)

**Returned value**

Returns a map with index-value pairs. [`Map`](/docs/sql-reference/data-types/map)

**Examples**

**Usage example**

```
SELECT numericIndexedVectorToMap(numericIndexedVectorBuild(mapFromArrays([1, 2, 3], [10, 20, 30]))) AS res;
```

```
┌─res──────────────┐
│ {1:10,2:20,3:30} │
└──────────────────┘
```

- [BSI](#bit-sliced-index)- [Create a numericIndexedVector object](#create-numeric-indexed-vector-object)- [groupNumericIndexedVector](#group-numeric-indexed-vector)- [numericIndexedVectorAllValueSum](#numericIndexedVectorAllValueSum)- [numericIndexedVectorBuild](#numericIndexedVectorBuild)- [numericIndexedVectorCardinality](#numericIndexedVectorCardinality)- [numericIndexedVectorGetValue](#numericIndexedVectorGetValue)- [numericIndexedVectorPointwiseAdd](#numericIndexedVectorPointwiseAdd)- [numericIndexedVectorPointwiseDivide](#numericIndexedVectorPointwiseDivide)- [numericIndexedVectorPointwiseEqual](#numericIndexedVectorPointwiseEqual)- [numericIndexedVectorPointwiseGreater](#numericIndexedVectorPointwiseGreater)- [numericIndexedVectorPointwiseGreaterEqual](#numericIndexedVectorPointwiseGreaterEqual)- [numericIndexedVectorPointwiseLess](#numericIndexedVectorPointwiseLess)- [numericIndexedVectorPointwiseLessEqual](#numericIndexedVectorPointwiseLessEqual)- [numericIndexedVectorPointwiseMultiply](#numericIndexedVectorPointwiseMultiply)- [numericIndexedVectorPointwiseNotEqual](#numericIndexedVectorPointwiseNotEqual)- [numericIndexedVectorPointwiseSubtract](#numericIndexedVectorPointwiseSubtract)- [numericIndexedVectorShortDebugString](#numericIndexedVectorShortDebugString)- [numericIndexedVectorToMap](#numericIndexedVectorToMap)

Was this page helpful?