How to split a column?

I would like to see if I can split a column in spark data. Like this,

Select employee, split(department,"_") from Employee 
+6
source share
1 answer

Try the following:

 SELECT explode(split(str, '_')) 

Or that:

 SELECT split(str, ' ')[0] as part1, split(str, ' ')[1] as part2 
+17
source

All Articles