在impala中每周检查一次数据

k0pti3hp  于 2021-06-01  发布在  Hadoop
关注(0)|答案(0)|浏览(254)

我有一个与学生(学生=1)的数据集,我需要每周监控这些学生。如何筛选特定日期的数据,然后在7天后和14天后对其进行监视?像这样的。只有这一部分起作用: (CASE WHEN (student = 1) and (start_date = '2015-04-01 00:00:00') THEN 1 ELSE 0 END) AS date_to_monitor, I think the date_add`给了夫人格里夫,因为它是在抱怨布尔类型

  1. Select *,
  2. (CASE WHEN (student = 1) and (start_date = '2015-04-01 00:00:00') THEN 1 ELSE 0 END) AS date_to_monitor,
  3. (CASE WHEN (student= 1) and (date_add(start_date = '2018-11-01 00:00:00' , 7)) THEN 1 ELSE 0 END) AS date_to_monitor,
  4. (CASE WHEN (student= 1) and (date_add(start_date = '2018-11-01 00:00:00' , 14)) THEN 1 ELSE 0 END) AS date_to_monitor,
  5. from old;

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题