Skip to content

Aggregation functions to support ARRAY data type and return ARRAY of equal size #6789

@jcsammy

Description

@jcsammy

Is your feature request related to a problem?

Current Array Functions

The current MAX, AVG, SUM functions operating on ARRAY data types all return SCALAR.

Feature Request 1 - Array Return Values

It would be useful to support performing these operations across multiple ARRAY of equal size and perform index-wise computations. This would leverage SIMD for speed.

In pseudo-code:

def amax(a1, a2):
  r = [0]*a1.length
  for ii in range(a1):
    r[ii] = max(a1[ii], a2[ii])
  return r

def asum(a1, a2):
  r = [0]*a1.length
  for ii in range(a1):
    r[ii] = a1[ii] +a2[ii]
  return r

Feature Request 2 - Array Aggregator Functions

It would furthermore be useful to support using these operations within a MATERIALIZED VIEW as aggregator functions. So tables with array data types could be aggregated together providing a index-wise MAX, SUM, etc. aggregation across the SAMPLE BY period.

Describe the solution you'd like.

No response

Describe alternatives you've considered.

No response

Full Name:

Jae Sammy

Affiliation:

Rincon Research

Additional context

Slack Discussion

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions