为什么 Hive 在使用按日期排序时抛出错误?

Why does Hive throw me an error while using Order by date?

我正在尝试在配置单元中编写查询,但看到以下错误。 “编译语句时出错:

FAILED: SemanticException Failed to breakup Windowing invocations into Groups. At least 1 group must only depend on input columns. Also check for circular dependencies. Underlying error: Primitve type DATE not supported in Value Boundary expression.

我在 Oracle sql 中使用了相同的查询,并且工作正常。如何在 Hive 中编写有效订单?

Select   
Email,
FIRST_VALUE(C.abc_cust_id) Over (Partition By Lower(email) Order By C.regt_date
 Desc)As CUSTOMER_ID
from table X

因为一些原始类型的支持(之前是没有DATE类型的)是在开窗之后加的,开窗没有修复。参见 HIVE-13973

作为解决方法,尝试将 DATE 转换为 STRING:

Over (Partition By Lower(email) Order By cast(C.regt_date as string) Desc)