0

Please help, getting this error when using Delta "replace where" SQL (not Python):

ParseException: 
mismatched input 'replace' expecting {'(', 'DESC', 'DESCRIBE', 'FROM', 'MAP', 'REDUCE', 'SELECT', 'TABLE', 'VALUES', 'WITH'}(line 1, pos 72)

== SQL ==
insert into table delta.`/path-to-table/` replace where replace_key in ('a', 'b') select * from vwt_df

I am using this guide (sql version): https://docs.databricks.com/delta/selective-overwrite.html#language-sql

P.S. I am trying to perform selective overwrite.

bda
  • 372
  • 1
  • 7
  • 22
  • 1
    What Databricks Runtime version is used? For SQL you need to be on DBR >= 12.0 – Alex Ott Feb 21 '23 at 17:56
  • I am on 10.4 LTS. What about the PySpark version of this operation? "replaceWhere"? Also in PySpark it does not seem to work with "in" predicate, i.e. "in ('a', 'b')" or does it also require 12.0? – bda Feb 21 '23 at 20:38
  • 1
    Not sure about IN operation, it should be documented – Alex Ott Feb 21 '23 at 21:59
  • Documentation does not seem to state any specific limitations regarding the allowed operators, nor shows any examples with the "IN" operation. The only examples shown are with "=><" operators. I would expect a firm statement somewhere that only "=><" operators are supported. If you happen to know where in documentation it is clearly stated about the allowed operators for "replaceWhere" that would be fantastic :) – bda Feb 22 '23 at 21:11

1 Answers1

1

Technical answer - issue is because old version of databricks runtime is used. For SQL support DBR 12.0+ is necessary as per documentation.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132