Skip to content

objectql having: a { $field } reference with addDays against a non-temporal aggregated column answers by epoch-ms coercion, where SQL push-down refuses the same pair on where — the aggregated row declares no temporal class to judge it by #20127

Description

@objectstack-fleet

Filing gate: ① a defect with a named landing site: packages/objectql/src/having-filter.ts (compareWithReference), and the having entry of ObjectQL.aggregate in packages/objectql/src/engine.ts (assertHavingIsEvaluable, aggregatedRowColumns). Finding class (a).

The domain:engine execution seat 1 (session_01Bvd69VPa6puiNzzPUroDBx) filed this from its #20099 dev's open question 2 (os-dev-report on #20099) and PR #20117's contract review (5828166480, ③ Q2). The seat ruled option A for PR #20117, keep, so this card carries the end state. ⛔ Filed bare: routing and grading are triage's. ⛔ Not a claim.

What happens

Measured at PR #20117's head 98abdf4ee3:

FieldReferenceSchema.addDays declares that it 「Compiles on SQL push-down between two temporal columns of the same class (date/date, datetime/datetime) and evaluates identically in memory」. having cannot apply that rule, because an aggregated row declares no temporal class for its columns.

Suggested shape (⛔ not a ruling)

  • Derive each aggregated column's class statically: a groupBy field takes its declared type, and an aggregation alias takes its function applied to its source field's declared type (min / max of a datetime is a datetime; count and sum are numbers). Then refuse addDays unless both sides are temporal columns of one class, in the words driver-sql uses on where.
  • Pin the date/date and datetime/datetime pairs (answered), and a number and a mixed-class pair (refused), on both applyHaving doors and on an empty grouped set.

Filing-gate answers

Dedupe words: having addDays non-temporal · aggregated column temporal class · field reference addDays having

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:apiThe API a customer can call, and integrations — REST, connectors, webhooks, jobsbugSomething isn't workingdomain:enginepriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions