Skip to content

The parser omits window clauses completly #34

@pgarne

Description

@pgarne

These clauses are very dangerous, because they introduce false positives. If the parser only supports a subset of SQL, it should error out otherwise. Not silently corrupt the query.

Also the parser swallows all column names. Maybe there should also be a way to also check for equality of the column names?

Reproducer:

CREATE TABLE sales (
  sale_id INTEGER,
  product_id INTEGER,
  PRIMARY KEY (sale_id)
);

SELECT
  sale_id,
  ROW_NUMBER() OVER (
    PARTITION BY product_id
    ORDER BY product_id
  ) as col_name
FROM sales;

SELECT
  sale_id,
  ROW_NUMBER() OVER ()
FROM sales;

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