简体   繁体   English

如何使用oozie在日期不确定的HDFS中查找数据路径

[英]How to use oozie to find data path in HDFS with uncertain date

I have a Hive table partitioned by date(eg 20150730) 我有一个按日期划分的Hive表(例如20150730)

Furthermore, I created a hive query which consumes today's partition date and the most recent previous partition date which is not necessary to be yesterday. 此外,我创建了一个配置单元查询,该查询使用了今天的分区日期和最近的以前的分区日期,而不必是昨天。 (eg 20150730 and 20150728) (例如20150730和20150728)

I want to use oozie to execute this hive query daily, but how can I find the previous partition date? 我想每天使用oozie执行此配置单元查询,但是如何找到以前的分区日期? (again the previous proportional date is unpredictable) (同样,以前的比例日期不可预测)

The Same kind of ques have been answed in the link. 链接中已经存在同类查询。 Hive Data selecting latest value based on timestamp Hive Data根据时间戳选择最新值

please have a check, you might need to apply some modification in mention example. 请检查一下,您可能需要在提及示例中进行一些修改。

As you mention Date is unpredictable, but believe it should be in format 正如您提到的那样,日期是不可预测的,但请相信它应该采用格式

also You can try someting like 你也可以尝试

SELECT DISTINCT(date) FROM partition_table ORDER BY usage_dt DESC limit 2;

these will give u previous Date even though if its not predictate... 这些将为您提供以前的日期,即使它无法预测...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM