在减去周末时间后找到时间差
id | start_time_ | end_time_time_time_time_diff | time_spent_working_days | 10308298 |
---|---|---|---|---|
1 | 2022-04-18 09:58:38.906 | 12:50 | 2022-04-18 | |
2 | :27.204 | 50 | 2022-04-18 | |
: | 2022-04-18 21:27:12.388 | 2022-04-18 21:27:27:27.227 | 14839 | |
4 | 2022-04-19 09:57:40.453 | 2022-04-19 09:59:59:59:59:07.612 | 87159 |
TIME_DIFT time_diff = end_diff = end_time_time_-start_time_- start_time _ bl br > time_spent_working_days =需要减去周末并找到时间差。
我能够计算启动时间和结束时间之间的差异以获取Time_diff,但是有人可以通过删除周末来帮助我获得Working_day持续时间。 (星期六/太阳 - 48小时)
ID | START_TIME_ | END_TIME_ | TIME_DIFF | TIME_SPENT_WORKING_DAYS |
---|---|---|---|---|
1 | 2022-04-18 09:58:38.906 | 2022-04-18 12:50:27.204 | 10308298 | |
2 | 2022-04-18 21:26:25.671 | 2022-04-18 21:26:36.313 | 10642 | |
3 | 2022-04-18 21:27:12.388 | 2022-04-18 21:27:27.227 | 14839 | |
4 | 2022-04-19 09:57:40.453 | 2022-04-19 09:59:07.612 | 87159 |
TIME_DIFF = END_TIME_ - START_TIME_
TIME_SPENT_WORKING_DAYS = Need to subtract the weekends and find the time difference.
I was able to calculate the difference between start_time and end time to get the time_diff, but can someone help me in getting the working_day duration by removing the weekends. (sat/sun -- 48 hours)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输入:
使用高阶功能的方法
汇总
和filter
:Spark 2.4+
的语法
的语法使用
爆炸>爆炸
和group> groupby
:Input:
Method using higher-order functions
aggregate
andfilter
:Syntax for Spark 2.4+
Method using
explode
andgroupBy
: