In certain situations, the use of the LEAD or LAG functions within the ORDER BY clause is not allowed

I found that, although Dremio 24.3 has addressed the issue of the LEAD and LAG functions not being able to set other offsets, problems arise when incorporating them into the ORDER BY statement. Please consider the following scenarios.

SQL:

SELECT SUM("销售额") AS "销售额",LAG(SUM("销售额"),12) OVER (ORDER BY TO_CHAR("发货日期",'yyyy-mm')) AS "同环比",TO_CHAR("发货日期",'yyyy-mm') AS "发货日期1" FROM "@admin".test."orders" GROUP BY TO_CHAR("发货日期",'yyyy-mm') ORDER BY LAG(SUM("销售额"),12) OVER (ORDER BY TO_CHAR("发货日期",'yyyy-mm')), TO_CHAR(发货日期,'yyyy-mm') DESC LIMIT 2000

result:

IllegalStateException: This generator does not support mappings beyond

parquet:
orders.zip (403.7 KB)

profile:
ddcd573a-4586-4cb1-b893-7a4a8475bd49.zip (18.4 KB)

version:(update from 24.1)