sql AIME因Text而被暂停

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql AIME因Text而被暂停相关的知识,希望对你有一定的参考价值。

WITH
  listing_table AS (
  SELECT
    id,
    agent_id 
  FROM
     `propertyguru-datalake-v0.propertydb_staging.sg_v_listing_active`
  WHERE status_code = 'ACT'
    GROUP BY 1,2),
    
  active_listing AS (
  SELECT
    agent_id,
    owner_id AS listing_id,
    media.id AS image_id,
    media.status_code AS image_status
  FROM
    `propertyguru-datalake-v0.propertydb_staging.sg_media` media
  INNER JOIN listing_table lt
  ON lt.id = media.owner_id
  WHERE status_code IN ('ACT','SUSP')
  ),
  
  agent_table AS (
  SELECT
  agent_id,
  mobile,
  email,
  firstname,
  lastname,
  agency_name,
  status_code,
  account_rule_code
  FROM
    `propertyguru-datalake-v0.propertydb_staging.sg_v_agent_search`
  WHERE status_code = 'ACT'
  ),

  image_confidence_table AS (
  SELECT
  mm.media_id,
  md.media_class,
  confident_level,
  ms.status AS moderator_status
  FROM
    `propertyguru-datalake-v0.propertydb_staging.sg_media_moderator_result` mm
  INNER JOIN `propertyguru-datalake-v0.production_pg_db05_propertydb.media`  md
  ON mm.media_id = md.id
  INNER JOIN  `propertyguru-datalake-v0.propertydb_staging.sg_media_moderator_status` ms
  ON mm.media_id = ms.media_id
  WHERE mm.reason_id = 12
  AND mm.confident_level >= 0.4
  ),


 final_image_table AS (
  SELECT
  media_id,
  media_class,
  listing_id,
  confident_level,
  image_status,
  moderator_status,
  al.agent_id
  FROM image_confidence_table img
  INNER JOIN active_listing al
  ON img.media_id = al.image_id
  ),
  
  final_table AS (
  SELECT
  media_id,
  media_class,
  listing_id,
  CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT("https://sg1-cdn.pgimgs.com/listing/",CAST(listing_id AS STRING)),"/"), media_class),"."),CAST(media_id AS STRING)),".V800.jpg") AS media_URL,
  confident_level, 
  image_status,
  moderator_status,
  CASE WHEN image_status = 'ACT' AND moderator_status = 'SUSPENDED' THEN "SOFT"
  WHEN image_status = 'SUSP' AND moderator_status = 'SUSPENDED' THEN "HARD" 
  ELSE NULL
  END AS suspended_status,
  al.agent_id,
  mobile,
  email,
  firstname,
  lastname,
  agency_name,
  status_code,
  account_rule_code
  FROM final_image_table img
  INNER JOIN agent_table al
  ON img.agent_id = al.agent_id
  )
  
  SELECT * FROM final_table
  WHERE suspended_status IS NOT NULL
  GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16

以上是关于sql AIME因Text而被暂停的主要内容,如果未能解决你的问题,请参考以下文章

sql 新加坡AIME表

Redshift 连接因错误而被拒绝

Iphone 4 sdk - 如何确定 applicationWillEnterForeground 是不是因通知而被触发?

应用因 Google Pay 而被拒绝

GitlabHQ - W 因导轨而被拒绝

信用卡交易是不是会因测试交易而被拒绝?