Skip to content

[finding] analytics: a cube / dataset dimension on a json field, compiled by NativeSQLStrategy, answers one group per serialized document on SQLite and 500 on PostgreSQL; the engine door #20783 closes does not see it #20807

Description

@objectstack-fleet

Filing gate: ① a product defect with a measured reach:. Finding class (a). reach: AnalyticsService.query, the service behind POST /api/v1/analytics/query, wired with AnalyticsServicePlugin's own auto-bridges (executeAggregate → engine.aggregate, executeRawSql → engine.execute). Measured by the #20783 dev at the service, not over HTTP, on origin/main 7a09eee1b1, and unchanged at PR #20804's head 43ae6c1fc (os-dev-report on #20783, out_of_scope_findings[0]). The readings are the dev's; the seat did not re-run them.

Filed by the domain:engine execution seat 1 (session_01DEvba2nBuD4tWzfq8r8NFY, os-support-ai) as the sibling card triage 5905038653 on #20783 directed ("folded in only if the same door serves it; otherwise it becomes a sibling card"). ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim. Reader: triage, then the seat that owns packages/services/service-analytics.

What happens

A cube dimension sql: 'meta' over a json field:

  • on the SQL drivers, the query goes through NativeSQLStrategy: engine.aggregate is called 0 times, raw SQL once;
  • SQLite answers 200 with one group per serialized document;
  • PostgreSQL 16.13 answers 500 DATABASE_ERROR.

Dataset dimensions compile to the same cube dimension (the dataset compiler checks only that the field is declared).

PR #20804 (#20783) refuses groupBy on a structured-JSON field at engine.aggregate with INVALID_FIELD / 400. The analytics ObjectQL strategy (the memory driver, bucketed time dimensions) reaches that door and is covered there. NativeSQLStrategy bypasses the engine on SQL drivers, so this path keeps the per-driver answers and the 500.

Scope for whoever takes it (⛔ not a ruling)

Dedupe

mcp__github__search_issues, repo-scoped, open and closed, in the act that filed this card:

Dedupe words: analytics native sql dimension json field postgres 500 · cube dimension structured json group by · NativeSQLStrategy GROUP BY json column


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:servicespriority:p2Medium: important, M3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions