by
Anku_
• New Contributor II
- 3662 Views
- 2 replies
- 0 kudos
Hi all,I am trying to get the domain from an email field using below expression; but getting an error.Kindly help. df.select(df.email, substring(df.email,instr(df.email,'@'),length(df.email).alias('domain')))
- 3662 Views
- 2 replies
- 0 kudos
Latest Reply
In your case, you want to extract the domain from the email, which starts from the position just after '@'. So, you should add 1 to the position of '@'. Also, the length of the substring should be the difference between the total length of the email ...
1 More Replies