An unknown-typed duql field gets its type from each batch at run time
DecisionVerified 5 Oct 2026Holds project: dftracer-utils
Decision. The context, the choice, why, and the options that were turned down.
Context#
A query names a field the catalog has no type for. Plan-time typing made the duql vectorizer turn an unknown type into nulls, so derive d = count * 2 returned an all-null d.
Decision#
An unknown-typed field gets its type from each batch's data while the query runs. A case the runtime typing cannot support must raise an error and never return null. Functions such as format_time on an unknown-typed field and string fields used in arithmetic must behave as they do with a full index. The same work fixed an older bug where a field that is int in some batches and float in others failed even with a full index.
Why#
Plan-time typing produced nulls for unknown types.
Rejected options#
- Plan-time typing (unknown became null).
- Guessing types from a sample, because a sample can miss rare types.
Also found by searching
- derive d = count * 2 returns an all-null column
- duql field with no catalog type becomes null
- format_time on an unknown-typed field
- field is int in some batches and float in others fails