https://delta.io logo
e

Edmondo Porcu

07/25/2023, 9:00 PM
Is there a way in Python to rename a column of a delta lake table without rewriting it all?
r

rtyler

07/25/2023, 9:47 PM
When you're asking "in Python" are you referring to from PySpark, or from the
deltalake
native python package?
e

Edmondo Porcu

07/25/2023, 10:45 PM
I can do both
m

Matthew Powers

07/26/2023, 12:48 PM
@Edmondo Porcu - yep, this is possible if you enable column mapping mode, see this blog post for more info: https://delta.io/blog/2022-08-29-delta-lake-drop-column/
e

Edmondo Porcu

07/31/2023, 12:58 AM
@Matthew Powers what if the table is not registered in a catalog?
m

Matthew Powers

07/31/2023, 7:47 PM
The same ALTER TABLE statement should work