Skip to content

[Compatibility]: MySQL JSON_TABLE syntax and relational expansion are unsupported #28036

Open

Description

@Ariznawlll

Description

MatrixOne does not parse MySQL JSON_TABLE(), preventing JSON documents from being expanded as a relational table in FROM.

Environment

  • Branch: main
  • Commit: 17c161a31b47a22e71ca222839143f66717ac365
  • Deployment: local single-node MatrixOne
  • Test date: 2026-09-03

Steps to reproduce

SELECT *
FROM JSON_TABLE('[{"a":1}]', '$[*]' COLUMNS(a INT PATH '$.a')) AS jt;\n```\n\n## Actual behavior\n\nThe parser rejects the `COLUMNS` clause.\n\n## Expected behavior\n\nMySQL `JSON_TABLE()` expands each path match into rows and supports scalar PATH columns, FOR ORDINALITY, EXISTS PATH, NESTED PATH, and ON EMPTY/ON ERROR behavior.\n\n## Stability and controls\n\n- Reproducer: parser rejection was identical in 3/3 rounds.\n- Control: scalar JSON functions such as `JSON_EXTRACT` and `JSON_VALUE` execute on the same service.\n- Failure atomicity: the reproducer is a read-only query.\n\n## Evidence\n\nhttps://dev.mysql.com/doc/refman/8.0/en/json-table-functions.html\n\n## Code analysis\n\nNo parser/plan implementation for `JSON_TABLE` exists; only MySQL-compatible error-code metadata refers to it.\n\n## Regression coverage\n\nAfter implementation, add BVT coverage for root-array expansion, typed columns, FOR ORDINALITY, EXISTS PATH, nested paths, ON EMPTY/ON ERROR, invalid input, and joins against preceding tables.

Activity

  1. added
    kind/bug
    on Sep 3, 2026
  2. added this to the MO-202609 milestone on Sep 3, 2026
  3. added theissue type on Sep 3, 2026
  4. added
    severity/s1
    and removed on Sep 4, 2026
  5. VioletQwQ-0 commented on Sep 5, 2026

    @VioletQwQ-0
    Collaborator

    JSON_TABLE implementation plan (2026-09-04)

    Triage is complete. This remains a kind/bug and is promoted to severity/s1; needs-triage has been removed. The current assignee and MO-202609 milestone remain unchanged.

    The compatibility target is the complete MySQL 8.0.27+ JSON_TABLE() behavior, verified against MySQL 8.0.46. This includes case-insensitive output-column names, all four column forms, ON EMPTY / ON ERROR, nested-path expansion, SQL type conversion, warning behavior, and implicit lateral joins.

    Delivery is split into four serial PRs:

    1. RFC and compatibility contract.
    2. Lazy JSON path iteration and reusable scalar-conversion foundations.
    3. Core parser, planner, and table-function execution.
    4. Remaining MySQL 8.0.27+ types, warnings, lateral/outer-join behavior, prepared/view/distributed coverage, and compatibility closure.

    Merge gates:

    The issue will remain open after implementation merges. It moves to phase/testing only after the final PR is merged and is closed only after an explicit QA PASS including MatrixOne version, environment, and test result.

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

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions