1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] AnalysisException: Multi-column In predicates are not supported in the DELETE condition

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 11, 2024 às 10:13.

  1. Stack

    Stack Membro Participativo

    I am doing the following in my databricks code. The code is trying to delete some rows from my table under conditions which seam simple to me.

    from datetime import datetime, timedelta

    today = datetime.today()
    yesterday = today - timedelta(days = int(look_back_days))
    yesterday_str = yesterday.strftime('%Y/%m/%d')

    query = f"""DELETE FROM table_name a WHERE AWB_ID IN (SELECT * FROM a WHERE a.DW_CRT_RUN_DT >= '{yesterday_str}' or a.dw_upd_run_dt >= '{yesterday_str}' and a.awb_Stus_cd = 'VOID' and a.dw_upd_pgm_id = 'DSPD0580')"""

    spark.sql(query)


    However, I got the following error.


    AnalysisException: Multi-column In predicates are not supported in the DELETE condition

    I also put what was suggested by @kombajn-zbożowy below, but it is still throwing the same error

    [​IMG]

    Continue reading...

Compartilhe esta Página