1 year ago

#347225

test-img

Reshma Joseph

Pyspark code giving wierd whitespace error

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

pyspark

apache-spark-sql

whitespace

removing-whitespace

trailing-whitespace

0 Answers

Your Answer

Accepted video resources