[SPARK-24131][PYSPARK] Add majorMinorVersion API to PySpark for determining Spark versions
[SPARK-24131][PYSPARK] Add majorMinorVersion API to PySpark for determining Spark versions

## What changes were proposed in this pull request?

We need to determine Spark major and minor versions in PySpark. We can add a `majorMinorVersion` API to PySpark which is similar to the Scala API in `VersionUtils.majorMinorVersion`.

## How was this patch tested?

Added tests.

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes #21203 from viirya/SPARK-24131.

lxsmnv/spark,lvdongr/spark,debugger87/spark,dbtsai/spark,HyukjinKwon/spark,pgandhi999/spark,holdenk/spark,shuangshuangwang/spark,debugger87/spark,szhem/spark,rezasafi/spark,JoshRosen/spark,LantaoJin/spark,pgandhi999/spark,eyalfa/spark,wangmiao1981/spark,spark-test/spark,jkbradley/spark,apache/spark,ConeyLiu/spark,zzcclp/spark,icexelloss/spark,spark-test/spark,ptkool/spark,jkbradley/spark,bdrillard/spark,michalsenkyr/spark,tejasapatil/spark,zhouyejoe/spark,chuckchen/spark,ptkool/spark,rikima/spark,JoshRosen/spark,shaneknapp/spark,dongjoon-hyun/spark,hhbyyh/spark,skonto/spark,cloud-fan/spark,hvanhovell/spark,witgo/spark,kevinyu98/spark,zhouyejoe/spark,hhbyyh/spark,techaddict/spark,rekhajoshm/spark,maropu/spark,rednaxelafx/apache-spark,icexelloss/spark,wangmiao1981/spark,mahak/spark,jiangxb1987/spark,ueshin/apache-spark,yanboliang/spark,ueshin/apache-spark,dbtsai/spark,JoshRosen/spark,hhbyyh/spark,gengliangwang/spark,tengpeng/spark,vinodkc/spark,facaiy/spark,jkbradley/spark,ConeyLiu/spark,michalsenkyr/spark,nchammas/spark,milliman/spark,shuangshuangwang/spark,pgandhi999/spark,lvdongr/spark,nchammas/spark,szhem/spark,wangmiao1981/spark,szhem/spark,holdenk/spark,pgandhi999/spark,jkbradley/spark,mahak/spark,milliman/spark,LantaoJin/spark,hvanhovell/spark,vinodkc/spark,lvdongr/spark,lxsmnv/spark,kevinyu98/spark,goldmedal/spark,vinodkc/spark,zero323/spark,bdrillard/spark,kiszk/spark,ConeyLiu/spark,srowen/spark,ptkool/spark,apache/spark,highfei2011/spark,wzhfy/spark,darionyaphet/spark,aosagie/spark,xuanyuanking/spark,witgo/spark,ueshin/apache-spark,bravo-zhang/spark,pgandhi999/spark,goldmedal/spark,markhamstra/spark,jiangxb1987/spark,lvdongr/spark,zuotingbing/spark,vinodkc/spark,rednaxelafx/apache-spark,icexelloss/spark,apache/spark,cloud-fan/spark,pgandhi999/spark,nchammas/spark,eyalfa/spark,kevinyu98/spark,pgandhi999/spark,actuaryzhang/spark,LantaoJin/spark,ahnqirage/spark,shaneknapp/spark,actuaryzhang/spark,ahnqirage/spark,holdenk/spark,shaneknapp/spark,jiangxb1987/spark,sahilTakiar/spark,zuotingbing/spark,lxsmnv/spark,witgo/spark,JoshRosen/spark,WindCanDie/spark,aosagie/spark,skonto/spark,xuanyuanking/spark,darionyaphet/spark,mdespriee/spark,srowen/spark,wangyum/spark,HyukjinKwon/spark,lvdongr/spark,icexelloss/spark,ConeyLiu/spark,BryanCutler/spark,hvanhovell/spark,sahilTakiar/spark,wangyum/spark,Aegeaner/spark,szhem/spark,ahnqirage/spark,dbtsai/spark,mahak/spark,kiszk/spark,WeichenXu123/spark,caneGuy/spark,hhbyyh/spark,cloud-fan/spark,actuaryzhang/spark,markhamstra/spark,rednaxelafx/apache-spark,zzcclp/spark,WeichenXu123/spark,mdespriee/spark,chuckchen/spark,wangmiao1981/spark,spark-test/spark,milliman/spark,xuanyuanking/spark,matthewfranglen/spark,actuaryzhang/spark,dongjoon-hyun/spark,nchammas/spark,debugger87/spark,mdespriee/spark,debugger87/spark,debugger87/spark,HyukjinKwon/spark,wangyum/spark,lxsmnv/spark,srowen/spark,jiangxb1987/spark,lxsmnv/spark,tejasapatil/spark,jiangxb1987/spark,tejasapatil/spark,chuckchen/spark,maropu/spark,sahilTakiar/spark,WeichenXu123/spark,aosagie/spark,maropu/spark,ptkool/spark,zero323/spark,xuanyuanking/spark,JoshRosen/spark,zhouyejoe/spark,caneGuy/spark,techaddict/spark,techaddict/spark,BryanCutler/spark,maropu/spark,WindCanDie/spark,tejasapatil/spark,aosagie/spark,ahnqirage/spark,witgo/spark,yanboliang/spark,BryanCutler/spark,shuangshuangwang/spark,michalsenkyr/spark,goldmedal/spark,guoxiaolongzte/spark,techaddict/spark,holdenk/spark,WindCanDie/spark,rezasafi/spark,dongjoon-hyun/spark,milliman/spark,chuckchen/spark,rekhajoshm/spark,zzcclp/spark,wangmiao1981/spark,highfei2011/spark,jkbradley/spark,sahilTakiar/spark,aosagie/spark,eyalfa/spark,wangyum/spark,zhouyejoe/spark,eyalfa/spark,rikima/spark,maropu/spark,xuanyuanking/spark,WindCanDie/spark,zuotingbing/spark,eyalfa/spark,caneGuy/spark,apache/spark,mahak/spark,techaddict/spark,aosagie/spark,vinodkc/spark,hvanhovell/spark,LantaoJin/spark,shaneknapp/spark,maropu/spark,cloud-fan/spark,facaiy/spark,rekhajoshm/spark,szhem/spark,bdrillard/spark,hvanhovell/spark,dbtsai/spark,Aegeaner/spark,taroplus/spark,zzcclp/spark,spark-test/spark,guoxiaolongzte/spark,WindCanDie/spark,nchammas/spark,Aegeaner/spark,ueshin/apache-spark,xuanyuanking/spark,ptkool/spark,facaiy/spark,milliman/spark,Aegeaner/spark,bravo-zhang/spark,actuaryzhang/spark,apache/spark,zero323/spark,rekhajoshm/spark,markhamstra/spark,rekhajoshm/spark,rezasafi/spark,lvdongr/spark,eyalfa/spark,zzcclp/spark,spark-test/spark,kiszk/spark,bravo-zhang/spark,ahnqirage/spark,tejasapatil/spark,debugger87/spark,LantaoJin/spark,rikima/spark,techaddict/spark,zuotingbing/spark,HyukjinKwon/spark,szhem/spark,sahilTakiar/spark,wangmiao1981/spark,caneGuy/spark,WeichenXu123/spark,shuangshuangwang/spark,WeichenXu123/spark,yanboliang/spark,dongjoon-hyun/spark,lxsmnv/spark,rezasafi/spark,dongjoon-hyun/spark,tejasapatil/spark,jkbradley/spark,rezasafi/spark,wzhfy/spark,nchammas/spark,rezasafi/spark,kevinyu98/spark,gengliangwang/spark,JoshRosen/spark,michalsenkyr/spark,kiszk/spark,highfei2011/spark,szhem/spark,goldmedal/spark,jiangxb1987/spark,zuotingbing/spark,ConeyLiu/spark,wangyum/spark,tengpeng/spark,zuotingbing/spark,kiszk/spark,mdespriee/spark,Aegeaner/spark,facaiy/spark,ueshin/apache-spark,kevinyu98/spark,HyukjinKwon/spark,rikima/spark,taroplus/spark,darionyaphet/spark,apache/spark,michalsenkyr/spark,icexelloss/spark,WindCanDie/spark,apache/spark,zzcclp/spark,markhamstra/spark,milliman/spark,facaiy/spark,darionyaphet/spark,shuangshuangwang/spark,holdenk/spark,tengpeng/spark,rednaxelafx/apache-spark,darionyaphet/spark,zhouyejoe/spark,cloud-fan/spark,shaneknapp/spark,skonto/spark,facaiy/spark,shuangshuangwang/spark,srowen/spark,facaiy/spark,caneGuy/spark,rekhajoshm/spark,srowen/spark,HyukjinKwon/spark,wzhfy/spark,bdrillard/spark,mahak/spark,wzhfy/spark,shuangshuangwang/spark,darionyaphet/spark,BryanCutler/spark,wangyum/spark,zzcclp/spark,wangyum/spark,eyalfa/spark,holdenk/spark,guoxiaolongzte/spark,sahilTakiar/spark,yanboliang/spark,shaneknapp/spark,ConeyLiu/spark,dongjoon-hyun/spark,tengpeng/spark,skonto/spark,tengpeng/spark,mdespriee/spark,guoxiaolongzte/spark,maropu/spark,icexelloss/spark,taroplus/spark,cloud-fan/spark,mahak/spark,taroplus/spark,witgo/spark,rednaxelafx/apache-spark,sahilTakiar/spark,skonto/spark,aosagie/spark,gengliangwang/spark,taroplus/spark,zero323/spark,rikima/spark,wzhfy/spark,lvdongr/spark,michalsenkyr/spark,LantaoJin/spark,hhbyyh/spark,wzhfy/spark,zhouyejoe/spark,goldmedal/spark,BryanCutler/spark,holdenk/spark,caneGuy/spark,mdespriee/spark,hvanhovell/spark,highfei2011/spark,cloud-fan/spark,debugger87/spark,dongjoon-hyun/spark,goldmedal/spark,zhouyejoe/spark,rednaxelafx/apache-spark,wangmiao1981/spark,rezasafi/spark,taroplus/spark,Aegeaner/spark,kiszk/spark,dbtsai/spark,mdespriee/spark,kevinyu98/spark,vinodkc/spark,guoxiaolongzte/spark,yanboliang/spark,bdrillard/spark,caneGuy/spark,chuckchen/spark,shaneknapp/spark,actuaryzhang/spark,ptkool/spark,bravo-zhang/spark,witgo/spark,highfei2011/spark,spark-test/spark,WindCanDie/spark,BryanCutler/spark,yanboliang/spark,Aegeaner/spark,bravo-zhang/spark,hhbyyh/spark,gengliangwang/spark,skonto/spark,markhamstra/spark,tejasapatil/spark,HyukjinKwon/spark,rekhajoshm/spark,lxsmnv/spark,guoxiaolongzte/spark,ueshin/apache-spark,kevinyu98/spark,bravo-zhang/spark,srowen/spark,mahak/spark,goldmedal/spark,chuckchen/spark,dbtsai/spark,tengpeng/spark,vinodkc/spark,ueshin/apache-spark,gengliangwang/spark,LantaoJin/spark,witgo/spark,darionyaphet/spark,WeichenXu123/spark,rikima/spark,BryanCutler/spark,markhamstra/spark,tengpeng/spark,skonto/spark,hhbyyh/spark,jiangxb1987/spark,zuotingbing/spark,ConeyLiu/spark,michalsenkyr/spark,markhamstra/spark,rikima/spark,bdrillard/spark,zero323/spark,highfei2011/spark,gengliangwang/spark,ahnqirage/spark,taroplus/spark,techaddict/spark,hvanhovell/spark,ahnqirage/spark,zero323/spark,guoxiaolongzte/spark,bdrillard/spark,xuanyuanking/spark,wzhfy/spark,highfei2011/spark,bravo-zhang/spark,nchammas/spark,spark-test/spark,ptkool/spark,yanboliang/spark,zero323/spark,actuaryzhang/spark,jkbradley/spark,WeichenXu123/spark,chuckchen/spark,milliman/spark,srowen/spark,JoshRosen/spark,gengliangwang/spark,icexelloss/spark,kiszk/spark,dbtsai/spark,rednaxelafx/apache-spark