There is exchange of Ca2+ Or Mg2+ ions with Na+ions present in sodium complex called permutit Na2Al2Si2O8 (also called zeolite)
Permutite can be obtained back by treating with NaCl.
This is also called ion exchange method. Here the water coming out as per the first process has ions Cl-. So its not de-ionised.