我想看看是否可以在spark数据帧中拆分一列。像这样,
Select employee, split(department,"_") from Employee
试试这个:
SELECT explode(split(str, '_'))
或者这个:
SELECT split(str, ' ')[0] as part1, split(str, ' ')[1] as part2