2

I am trying to replace special characters from a table column using SQL a SQL query. However, I get the following error. Can anyone tell me what I did wrong or how I should approach this?

SQL QUERY

UPDATE wine SET description = REPLACE(description, '%', '')

ERROR

error in sql statement: analysisexception: update destination only supports delta sources.
ApplePie
  • 1,155
  • 3
  • 12
  • 30

2 Answers2

2

Databricks only supports updates for delta (delta lake) tables. The error message indicates that you try the update on a non-delta-table. So you would have to convert your data source to delta. For parquet it is very simple:

CONVERT TO DELTA parquet.`path/to/table` [NO STATISTICS]
[PARTITIONED BY (col_name1 col_type1, col_name2 col_type2, ...)]

See the Documentation for more details.

Hauke Mallow
  • 2,887
  • 3
  • 11
  • 29
0

CONVERT TO DELTA parquet.s3://path/to/table PARTITIONED BY (column_name INT) ;

--try this for partioned table

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 19 '22 at 07:39