Skip to content

ClickHouse table function is recognized as TableFactor::Table #2027

@pravic

Description

@pravic

See https://clickhouse.com/docs/sql-reference/table-functions.

For example:

SELECT * FROM test;
SELECT * FROM test();

They produce:

pre_visit_table_factor: Table { name: ObjectName([Identifier(Ident { value: "test", quote_style: None, span: Span(Location(1,16)..Location(1,20)) })]), alias: None, args: None, with_hints: [], version: None, with_ordinality: false, partitions: [], json_path: None, sample: None, index_hints: [] }

and

pre_visit_table_factor: Table { name: ObjectName([Identifier(Ident { value: "test", quote_style: None, span: Span(Location(1,16)..Location(1,20)) })]), alias: None, args: Some(TableFunctionArgs { args: [], settings: None }), with_hints: [], version: None, with_ordinality: false, partitions: [], json_path: None, sample: None, index_hints: [] }

The second version produces args: Some(TableFunctionArgs { args: [], settings: None }).

As I see it's because Function is only recognized after a LATERAL keyword, and TableFunction is only for the TABLE() syntax (but not for ident()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions