It doesn't matter what your degree is in for an airline pilot.
If you want to end up being a Test Pilot, then you need some type of engineering background. Science/engineering with advanced degrees are also required by NASA, and probably help for some of the new commercial space ventures starting up.