Skip to content

Audit that a declared return type is one an executor writes - #344

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/duck-return-type-audit
Aug 28, 2026
Merged

Audit that a declared return type is one an executor writes#344
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/duck-return-type-audit

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

A hand-written binding declares its result type twice: in the ScalarFunction registration DuckDB reads, and in the executor template argument that decides which C++ type is written into the result vector. Nothing makes the two agree, and when they disagree the executor writes one width into a vector allocated for another. scripts/return-type-audit.py pairs them by implementation and reports every declared LogicalType no executor writes. A body reaches a type either directly or through a helper template, and both count as written, so a function dispatching through a helper is read as writing the types it instantiates rather than only its last branch. The audit is source-only and runs as its own pull-request job, answering in seconds rather than waiting on a build.

A hand-written binding declares its result type twice: in the
ScalarFunction registration DuckDB reads, and in the executor template
argument that decides which C++ type is written into the result vector.
Nothing makes the two agree, and when they disagree the executor writes
one width into a vector allocated for another.

scripts/return-type-audit.py pairs them by implementation and reports
every declared LogicalType no executor writes. A body reaches a type
either directly or through a helper template, and both count as written,
so a function dispatching through a helper is read as writing the types
it instantiates rather than only its last branch. The audit is
source-only and runs as its own pull-request job.
@estebanzimanyi
estebanzimanyi merged commit f0cd736 into MobilityDB:main Aug 28, 2026
10 checks passed
@estebanzimanyi
estebanzimanyi deleted the fix/duck-return-type-audit branch August 28, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant