Skip to content

[SQL] Confusing error message for ROW_NUMBER #5822

@mihaibudiu

Description

@mihaibudiu
CREATE TABLE payments (
  payment_id BIGINT,
  customer_id BIGINT,
  payment_time TIMESTAMP,
  amount DECIMAL(12, 2),
  payment_method VARCHAR
);

CREATE VIEW bm06_customer_payment_windows AS
SELECT
  customer_id,
  payment_time,
  amount,
  ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY payment_time) AS payment_number,
  LAG(amount) OVER (PARTITION BY customer_id ORDER BY payment_time) AS previous_amount,
  SUM(amount) OVER (
    PARTITION BY customer_id
    ORDER BY payment_time
    ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
  ) AS running_amount
FROM payments
error: Not yet implemented Multiple RANK aggregates per window
 You can suggest support for this feature by filing an issue at https://github.com/feldera/feldera/issues
 14| ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY payment_time) AS payment_number,
     ^^^^^^^^^^^^
 15| LAG(amount) OVER (PARTITION BY customer_id ORDER BY payment_time) AS previous_amount

The error message should say that ROW_NUMBER is only supported in a TopK pattern. There is only one in this example.
This used to work.

Metadata

Metadata

Assignees

Labels

SQL compilerRelated to the SQL compiler

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions