I have rooted my s8. It was causing some problem and i went to service center. They said that device has been rooted, so fixing the problem will be charged. Does rooting your device take your warranty?
Yup. And it will affect future updates (read you won't get any) once you trip the security system in the device.
Not needed or recommended these days unless you do it recreationally to a phone that's not your daily driver..