apache / apache/datafusion

SLT test coverage for functions ensuring scalar & vectorized execution matches

Open
#16,592 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

based on

- https://github.com/apache/datafusion/pull/15486#issuecomment-3014122915
- https://github.com/apache/datafusion/issues/16531
- https://github.com/apache/datafusion/pull/16539#discussion_r2165199807

it is too easy to write code that

- works for ColumnarValue::Scalar but does not work for ColumnarValue::Array
- works for ColumnarValue::Scalar differently than for ColumnarValue::Array

The function tests are mostly based around scalars, eg. `SELECT foo(1)`.
Ideally that would be sufficient to exercise both code paths. For that, we need alternative execution modes

### Proposed solution

We could imagine modes like

- force vectorization of all input values to a UDF. When there is only a single value, duplicate it.
- force scalarization of UDF input. When there is multiple values, call the function in a loop for each one
- do both at the same time and compare results

depending which mix of modes we choose, we may need to run SLT tests 1-3 times.

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked pull requests and issues, then inspect the existing SLT function-test harness. Determine how scalar and array inputs are currently executed and how alternative execution modes could compare their results. Done means SLT coverage exercises the relevant scalar and vectorized paths and detects mismatches.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.