Skip to content

fix: walk pipe-syntax FromQuery in SelectVisitorAdapter - #2953

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
tanjiroK-coder:pipe-query-traversal
Nov 23, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
tanjiroK-coder:pipe-query-traversal

Conversation

@tanjiroK-coder

Copy link
Copy Markdown
Contributor

SelectVisitorAdapter.visit(FromQuery) and ExpressionVisitorAdapter.visit(FromQuery) return null, so nothing inside a BigQuery / Databricks pipe query is traversed: not the FROM item, its joins and LATERAL VIEW generators, the WITH list, or any |> operator. StatementFeatureVisitor builds on the adapter, so FROM t |> WHERE purge_audit() = 0 came back as certain=[RETURNS_RESULT_SET] with mayModifyData() == false and no unresolved reference and passed the read-only guard in usage.rst, while SELECT purge_audit() FROM t leaves MODIFIES_DATA possible with unresolved=[purge_audit]. The same held for |> SELECT, EXTEND, SET, AGGREGATE, ORDER BY, LIMIT, JOIN, CALL, UNION, PIVOT and WINDOW; WITH c AS (DELETE FROM t RETURNING *) FROM c |> SELECT a was reported as not modifying data at all, and no pipe query reported READS_DATA. The adapter now walks a FromQuery the way TablesNamesFinder.visit(FromQuery) already does, with one case per pipe operator; the expression adapter hands a FromQuery to the select visitor like any other Select, and FeatureSelectVisitor reports READS_DATA for it, since a pipe query always starts from a FROM item. The new functionIsChecked and dataModifyingCteBeforePipeQuery cases fail before (16 failures) and pass after; spotlessCheck, Checkstyle, PMD, SpotBugs and checkGrammarAmbiguity pass, and the only other ./gradlew check failures locally are 33 Mockito inline-mock-maker init errors in the mock-based tests and 2 AccessDeniedExceptions from ParserKeywordsUtilsTest writing its grammar temp file, both environment problems on this machine that do not touch the visitors. SelectValidator.visit(FromQuery) also returns early; I left it alone here because it first needs a decision on which Feature the pipe syntax should map to.

@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you!

@manticore-projects
manticore-projects merged commit 12f17fb into JSQLParser:master Nov 23, 2026
10 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.

2 participants