Pyspark code giving wierd whitespace error

96 Views Asked by At

Error

When I ran this query, zip code is getting some hidden whitespace which pushes over to data-source column. Tried trim function and trim with carriage return, whitespace is not getting removed. Any suggestions?

Note: window partition was used to get zip code

select 
      distinct x, 
      first_value(zip_code) 
      over(partition by x order by date_time_closed desc) as zip_code 
from table
0

There are 0 best solutions below