-werners-
Esteemed Contributor III

if you use saveAsTable without any .format() option, it will be saved as a delta lake table.
You also do not specify a location so it gets saved to the default location.  I don't know what that is on community edition, but if something is already present with the same name, the write will fail.
You can try to use .mode("overwrite") with the write.
Or clean up the location first (that is of course only an option for test purposes).