Skip to content

doris: support LATERAL VIEW; starrocks: pin its engine-rejection - #406

Merged
rebelice merged 1 commit into
mainfrom
lateral-view
Aug 28, 2026
Merged

doris: support LATERAL VIEW; starrocks: pin its engine-rejection#406
rebelice merged 1 commit into
mainfrom
lateral-view

Conversation

@rebelice

Copy link
Copy Markdown
Collaborator

What

Bumping bytebase to the strict parser (#402/#403) surfaced LATERAL VIEW as a previously-swallowed construct: the old parser truncated SELECT * FROM person LATERAL VIEW EXPLODE(ARRAY(30, 60)) tableName AS c_age at LATERAL and "accepted" the prefix — the clause never reached the AST or lineage.

Container-verified against Doris 3.1.4 and StarRocks 3.4.10:

  • doris: parse LATERAL VIEW generator(args) tableAlias AS col[, col...] as a chainable TableRef suffix (new ast.LateralView, wired into Walk; the span walker analyzes the generator's expressions, so a subquery inside one contributes its table read and the lateral alias is not reported as a physical table). Engine-verified boundaries: the table alias and AS list are required, the OUTER variant is rejected, and trailing junk after the clause stays rejected.
  • starrocks: the engine has no Hive-style LATERAL VIEW at all (its lateral form is , [LATERAL] unnest(...), already supported), so the parser is unchanged and the rejection is pinned in the conformance matrix. The bytebase-side StarRocks smoke test asserting the old swallow-based "accept" will be flipped in the bytebase bump PR.

Verification

  • Engine verdict battery (10 shapes × both engines) drove every accept/reject decision.
  • -short suites green; both container conformance matrices replayed green (doris +9 cases, starrocks +2).
  • Span test pins generator-subquery lineage (EXPLODE((SELECT arr FROM t3 ...))t3 in AccessTables).

🤖 Generated with Claude Code

…-10085 fallout)

Bumping bytebase to the strict parser surfaced LATERAL VIEW as a
previously-swallowed construct: the old parser truncated
SELECT * FROM person LATERAL VIEW EXPLODE(...) tmp AS c at LATERAL and
"accepted" the prefix, losing the clause from lineage.

Container-verified against Doris 3.1.4 and StarRocks 3.4.10:

- doris: parse LATERAL VIEW generator(args) tableAlias AS col[, col...]
  as a chainable TableRef suffix (new ast.LateralView, walked; the span
  walker analyzes the generator's expressions, so a subquery inside one
  contributes its table read and the lateral alias is not reported as a
  physical table). The engine requires the table alias and the AS list
  and has no OUTER variant — those forms stay rejected, as does trailing
  junk after the clause.
- starrocks: the engine has no Hive-style LATERAL VIEW at all (its
  lateral form is `, [LATERAL] unnest(...)`, already supported), so the
  parser is unchanged and the rejection is pinned in the conformance
  matrix.

Both matrices replayed green (doris +9 cases, starrocks +2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rebelice
rebelice merged commit 044f516 into main Aug 28, 2026
23 checks passed
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