Regular expression with Spark sql

 if you have data where you want to filter out all special characters along with numeric character from string then use spark sql regular expression function  - regexp_replace


Example : -

      Name

      sbdgd&(&**,4343

      ram7534- 5%7777


Select  regexp_replace(name, '[^a-zA-z]', ' ') as name from table_name


Result:

  Name

  sbdgd

  ram

Comments

Popular posts from this blog

Date format issue with spark sql

Root path does not exist

Dataiku and Dremio date difference