Skip to content

Conversation

@alexander-beedie
Copy link
Contributor

@alexander-beedie alexander-beedie commented Jan 8, 2026

There's a bug in Pipe SQL parsing with identifiers followed by the |> operator.

Fix

parse_identifiers needs to break on Token::VerticalBarRightAngleBracket as well, otherwise it continues to consume the following tokens as Ident (until one of the other break conditions is encountered).

Example

FROM t |> DROP c |> RENAME a AS x

Without the fix the DROP section consumes the RENAME tokens as identifiers:

Drop { columns: [
    Ident { value: "c" },
    Ident { value: "RENAME" },
    Ident { value: "a" },
    Ident { value: "AS" },
    Ident { value: "x" }]
}

After the fix the identifier boundary is respected, and the operations parse correctly:

Drop { columns: [Ident { value: "c" }] }
Rename { mappings: [
    IdentWithAlias { ident: Ident { value: "a" }, alias: Ident { value: "x" } }]
}

Also

Updated the pipe operator tests with some new coverage for the above, and a helper that additionally validates queries that start "FROM <tbl>" (in addition to "SELECT * FROM <tbl>") with the pipe operator.

@alexander-beedie alexander-beedie changed the title Fix identifier parsing not breaking on the pipe operator Fix identifier parsing not breaking on the |> pipe operator Jan 8, 2026
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