hadoop—验证db2.table2中的db1.table1数据元素是否正确地从utc转换为est

xwbd5t1u  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(354)

必须验证db1.table.a\u timestamp中的utc时间是否在db2.table2.a\u est\u ts中正确转换为est时间。

  1. SELECT dsr_ticket_number, from_utc_timestamp(acknowledgement_timestamp, 'EST') from data_prcy_pds_sanitized.dsr_sor_delete_request
  2. where dsr_ticket_number, from_utc_timestamp(acknowledgement_timestamp, 'EST')
  3. 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)

dtcbnfnu

dtcbnfnu1#

使用join而不是in:

  1. select a.dsr_ticket_number, from_utc_timestamp(acknowledgement_timestamp, 'EST')
  2. from data_prcy_pds_sanitized.dsr_sor_delete_request a
  3. left join (select distinct dsr_ticket_num, acknowledgement_est_ts
  4. from data_prcy_dsr_conformed.data_subj_rqst_delete) b
  5. on a.dsr_ticket_number = b.dsr_ticket_num
  6. and from_utc_timestamp(a.acknowledgement_timestamp, 'EST') = b.acknowledgement_est_ts
  7. where b.dsr_ticket_num is not null
  8. --or to find records which are not in second table
  9. --use WHERE b.dsr_ticket_num is null

相关问题