hadoop - 验证 dB1.table1 数据元素是否在 dB2.table2 中正确地从 UTC 转换为 EST
问题描述
必须验证 db1.table.a_timestamp 中的 UTC 时间在 dB2.table2.a_est_ts 中正确转换为 EST 时间。
SELECT dsr_ticket_number, from_utc_timestamp(acknowledgement_timestamp, 'EST') from data_prcy_pds_sanitized.dsr_sor_delete_request
where dsr_ticket_number, from_utc_timestamp(acknowledgement_timestamp, 'EST')
in (select dsr_ticket_num,acknowledgement_est_ts from data_prcy_dsr_conformed.data_subj_rqst_delete)
给我一条错误消息:org.apache.spark.sql.catalyst.parser.ParseException: mismatched input ',' expecting <EOF>(line 2, pos 23)
解决方案
使用 join 而不是 IN:
select a.dsr_ticket_number, from_utc_timestamp(acknowledgement_timestamp, 'EST')
from data_prcy_pds_sanitized.dsr_sor_delete_request a
left join (select distinct dsr_ticket_num, acknowledgement_est_ts
from data_prcy_dsr_conformed.data_subj_rqst_delete) b
on a.dsr_ticket_number = b.dsr_ticket_num
and from_utc_timestamp(a.acknowledgement_timestamp, 'EST') = b.acknowledgement_est_ts
where b.dsr_ticket_num is not null
--or to find records which are not in second table
--use WHERE b.dsr_ticket_num is null
推荐阅读
- javascript - i18nProvider 为默认语言环境的消息返回了一个 Promise。反应管理员
- python - Pandas groupby 根据排名保留行
- octave - Octave 有画垂直线的 xline 功能吗?
- javascript - 通过过渡每分钟更改背景图像
- c# - 如何制作一半“RadialProgressBar”
- amazon-web-services - 检查哪些 ebextensions 已运行
- java - 将 Spring Boot 应用程序推送到 Heroku 未完成
- javascript - javascript函数在require语句后什么时候需要空括号?
- javascript - jquery.trim() 是否已弃用?
- unity3d - 如何让玩家可以访问资产进行改装?