我能够在mysql中找到两个日期之间的差异,但是相同的查询在hive中不起作用。
我有一张table,上面有假日的日期表。
SELECT bd.*,
(SELECT COUNT(*) FROM holiday WHERE h_date BETWEEN bd.t_date AND bd.start_date) as holiday_count
FROM biz_date as bd
配置单元中出错:
Error: Error while compiling statement: FAILED: ParseException line 2:1 cannot recognize input near 'SELECT' 'COUNT' '(' in expression specification (state=42000,code=40000)
1条答案
按热度按时间laik7k3q1#
这就是你要找的吗?
输出:
完整测试代码: