[SPARK-15456][PYSPARK] Fixed PySpark shell context initialization when HiveConf not present
[SPARK-15456][PYSPARK] Fixed PySpark shell context initialization when HiveConf not present

## What changes were proposed in this pull request?

When PySpark shell cannot find HiveConf, it will fallback to create a SparkSession from a SparkContext.  This fixes a bug caused by using a variable to SparkContext before it was initialized.

## How was this patch tested?

Manually starting PySpark shell and using the SparkContext

Author: Bryan Cutler <cutlerb@gmail.com>

Closes #13237 from BryanCutler/pyspark-shell-session-context-SPARK-15456.

ahnqirage/spark,michalsenkyr/spark,gengliangwang/spark,BryanCutler/spark,aosagie/spark,pgandhi999/spark,jianran/spark,HyukjinKwon/spark,liutang123/spark,xuanyuanking/spark,rednaxelafx/apache-spark,markhamstra/spark,byakuinss/spark,apache/spark,taroplus/spark,andrewor14/spark,ericvandenbergfb/spark,debugger87/spark,chuckchen/spark,UndeadBaneGitHub/spark,publicRoman/spark,loneknightpy/spark,maropu/spark,liutang123/spark,poffuomo/spark,poffuomo/spark,wzhfy/spark,caneGuy/spark,kevinyu98/spark,ibm-research-ireland/sparkoscope,zero323/spark,stanzhai/spark,HyukjinKwon/spark,taroplus/spark,joseph-torres/spark,wzhfy/spark,panfengfeng/spark,rednaxelafx/apache-spark,lxsmnv/spark,zzcclp/spark,yanboliang/spark,lvdongr/spark,1haodian/spark,guoxiaolongzte/spark,bravo-zhang/spark,jrshust/spark,taroplus/spark,stanzhai/spark,adrian-ionescu/apache-spark,szhem/spark,janewangfb/spark,kevinyu98/spark,shuangshuangwang/spark,techaddict/spark,hvanhovell/spark,bOOm-X/spark,maropu/spark,Panos-Bletsos/spark-cost-model-optimizer,mdespriee/spark,jkbradley/spark,matthewfranglen/spark,mzl9039/spark,bOOm-X/spark,esi-mineset/spark,mahak/spark,eyalfa/spark,jrshust/spark,bravo-zhang/spark,janewangfb/spark,joseph-torres/spark,szhem/spark,panfengfeng/spark,zzcclp/spark,sahilTakiar/spark,michalsenkyr/spark,caneGuy/spark,maropu/spark,apache/spark,UndeadBaneGitHub/spark,michalsenkyr/spark,cloud-fan/spark,ibm-research-ireland/sparkoscope,debugger87/spark,ericvandenbergfb/spark,jlopezmalla/spark,yanboliang/spark,aosagie/spark,yanboliang/spark,caneGuy/spark,rezasafi/spark,JoshRosen/spark,ptkool/spark,LantaoJin/spark,hhbyyh/spark,pgandhi999/spark,Panos-Bletsos/spark-cost-model-optimizer,holdenk/spark,ueshin/apache-spark,map222/spark,bdrillard/spark,ibm-research-ireland/sparkoscope,pgandhi999/spark,alunarbeach/spark,JoshRosen/spark,zuotingbing/spark,sahilTakiar/spark,milliman/spark,someorz/spark,jiangxb1987/spark,liyichao/spark,publicRoman/spark,vinodkc/spark,aokolnychyi/spark,icexelloss/spark,debugger87/spark,sachintyagi22/spark,xflin/spark,nilsgrabbert/spark,map222/spark,markhamstra/spark,nchammas/spark,highfei2011/spark,witgo/spark,maropu/spark,sureshthalamati/spark,big-pegasus/spark,dhruve/spark,andrewor14/spark,dongjoon-hyun/spark,rekhajoshm/spark,SHASHANKB/spark,metamx/spark,BryanCutler/spark,lvdongr/spark,bdrillard/spark,zero323/spark,debugger87/spark,icexelloss/spark,wangyum/spark,huang1900/spark,ueshin/apache-spark,jianran/spark,tengpeng/spark,lvdongr/spark,ddna1021/spark,ericvandenbergfb/spark,jiangxb1987/spark,SHASHANKB/spark,jiangxb1987/spark,actuaryzhang/spark,map222/spark,jianran/spark,eyalfa/spark,jlopezmalla/spark,apache-spark-on-k8s/spark,witgo/spark,cin/spark,WeichenXu123/spark,JoshRosen/spark,tengpeng/spark,kissmetrics/spark,facaiy/spark,darionyaphet/spark,bravo-zhang/spark,skonto/spark,JerryLead/spark,chuckchen/spark,BryanCutler/spark,panfengfeng/spark,jkbradley/spark,apache-spark-on-k8s/spark,rekhajoshm/spark,panfengfeng/spark,sureshthalamati/spark,highfei2011/spark,dbtsai/spark,darionyaphet/spark,shuangshuangwang/spark,actuaryzhang/spark,jlopezmalla/spark,xuanyuanking/spark,milliman/spark,actuaryzhang/spark,narahari92/spark,minixalpha/spark,bOOm-X/spark,HyukjinKwon/spark,holdenk/spark,janewangfb/spark,map222/spark,SnappyDataInc/spark,1haodian/spark,sahilTakiar/spark,nlalevee/spark,esi-mineset/spark,andrewor14/spark,narahari92/spark,srowen/spark,akopich/spark,zero323/spark,akopich/spark,sachintyagi22/spark,mahak/spark,WeichenXu123/spark,nilsgrabbert/spark,cin/spark,ioana-delaney/spark,ron8hu/spark,jianran/spark,Panos-Bletsos/spark-cost-model-optimizer,saturday-shi/spark,alunarbeach/spark,esi-mineset/spark,ron8hu/spark,mahak/spark,hvanhovell/spark,milliman/spark,metamx/spark,JerryLead/spark,liyichao/spark,mike0sv/spark,ConeyLiu/spark,MLnick/spark,shuangshuangwang/spark,wzhfy/spark,apache/spark,big-pegasus/spark,liyichao/spark,SnappyDataInc/spark,mdespriee/spark,xflin/spark,Aegeaner/spark,JoshRosen/spark,joseph-torres/spark,ibm-research-ireland/sparkoscope,rekhajoshm/spark,jlopezmalla/spark,panfengfeng/spark,brad-kaiser/spark,hvanhovell/spark,aray/spark,caneGuy/spark,ericvandenbergfb/spark,darionyaphet/spark,highfei2011/spark,joseph-torres/spark,nchammas/spark,WeichenXu123/spark,ron8hu/spark,narahari92/spark,kissmetrics/spark,loneknightpy/spark,janewangfb/spark,stanzhai/spark,facaiy/spark,Panos-Bletsos/spark-cost-model-optimizer,esi-mineset/spark,ron8hu/spark,goldmedal/spark,saltstar/spark,saltstar/spark,rikima/spark,kevinyu98/spark,ueshin/apache-spark,adrian-ionescu/apache-spark,big-pegasus/spark,SHASHANKB/spark,witgo/spark,goldmedal/spark,saturday-shi/spark,WindCanDie/spark,HyukjinKwon/spark,metamx/spark,someorz/spark,kimoonkim/spark,WindCanDie/spark,skonto/spark,liutang123/spark,stanzhai/spark,JerryLead/spark,kevinyu98/spark,shaneknapp/spark,UndeadBaneGitHub/spark,ericvandenbergfb/spark,dhruve/spark,wangmiao1981/spark,caneGuy/spark,1haodian/spark,SnappyDataInc/spark,goldmedal/spark,jlopezmalla/spark,metamx/spark,apache/spark,ajaysaini725/spark,aosagie/spark,liutang123/spark,gengliangwang/spark,mdespriee/spark,kevinyu98/spark,metamx/spark,JoshRosen/spark,JerryLead/spark,kevinyu98/spark,BryanCutler/spark,witgo/spark,cin/spark,adrian-ionescu/apache-spark,dongjoon-hyun/spark,dongjoon-hyun/spark,vinodkc/spark,setjet/spark,shaneknapp/spark,spark-test/spark,setjet/spark,ahnqirage/spark,brad-kaiser/spark,esi-mineset/spark,SHASHANKB/spark,ahnqirage/spark,ueshin/apache-spark,cloud-fan/spark,gengliangwang/spark,alunarbeach/spark,vinodkc/spark,saturday-shi/spark,dongjoon-hyun/spark,shuangshuangwang/spark,techaddict/spark,guoxiaolongzte/spark,mahak/spark,jrshust/spark,actuaryzhang/spark,jkbradley/spark,shaneknapp/spark,ron8hu/spark,Panos-Bletsos/spark-cost-model-optimizer,WindCanDie/spark,brad-kaiser/spark,brad-kaiser/spark,bravo-zhang/spark,holdenk/spark,kissmetrics/spark,Aegeaner/spark,nchammas/spark,joseph-torres/spark,xflin/spark,ptkool/spark,liyichao/spark,UndeadBaneGitHub/spark,mdespriee/spark,chuckchen/spark,big-pegasus/spark,cloud-fan/spark,rekhajoshm/spark,jlopezmalla/spark,aray/spark,Aegeaner/spark,chuckchen/spark,map222/spark,cin/spark,huang1900/spark,zzcclp/spark,andrewor14/spark,shubhamchopra/spark,lvdongr/spark,yanboliang/spark,ueshin/apache-spark,bdrillard/spark,guoxiaolongzte/spark,holdenk/spark,WindCanDie/spark,wangmiao1981/spark,1haodian/spark,rezasafi/spark,tejasapatil/spark,skonto/spark,markhamstra/spark,ptkool/spark,mike0sv/spark,MLnick/spark,ioana-delaney/spark,lxsmnv/spark,minixalpha/spark,nilsgrabbert/spark,mahak/spark,tejasapatil/spark,jianran/spark,rezasafi/spark,rednaxelafx/apache-spark,minixalpha/spark,liutang123/spark,zero323/spark,byakuinss/spark,sureshthalamati/spark,dbtsai/spark,akopich/spark,sachintyagi22/spark,spark-test/spark,nlalevee/spark,rekhajoshm/spark,patrick-nicholson/spark,wzhfy/spark,dhruve/spark,saturday-shi/spark,ddna1021/spark,zzcclp/spark,lxsmnv/spark,skonto/spark,liyichao/spark,szhem/spark,chuckchen/spark,maropu/spark,mike0sv/spark,metamx/spark,sahilTakiar/spark,saltstar/spark,highfei2011/spark,ptkool/spark,tengpeng/spark,zhouyejoe/spark,mzl9039/spark,sachintyagi22/spark,guoxiaolongzte/spark,ptkool/spark,wangyum/spark,saturday-shi/spark,aray/spark,esi-mineset/spark,apache-spark-on-k8s/spark,ahnqirage/spark,aosagie/spark,mike0sv/spark,shubhamchopra/spark,ajaysaini725/spark,dongjoon-hyun/spark,xflin/spark,Aegeaner/spark,debugger87/spark,gengliangwang/spark,janewangfb/spark,cin/spark,huang1900/spark,saltstar/spark,dongjoon-hyun/spark,taroplus/spark,zero323/spark,tengpeng/spark,mzl9039/spark,JerryLead/spark,SHASHANKB/spark,guoxiaolongzte/spark,saltstar/spark,wangmiao1981/spark,wangmiao1981/spark,jrshust/spark,shubhamchopra/spark,chuckchen/spark,zhouyejoe/spark,jlopezmalla/spark,szhem/spark,ioana-delaney/spark,apache-spark-on-k8s/spark,ptkool/spark,ajaysaini725/spark,zzcclp/spark,adrian-ionescu/apache-spark,hhbyyh/spark,MLnick/spark,jiangxb1987/spark,xuanyuanking/spark,WeichenXu123/spark,spark-test/spark,publicRoman/spark,aokolnychyi/spark,ConeyLiu/spark,LantaoJin/spark,mdespriee/spark,tengpeng/spark,nlalevee/spark,icexelloss/spark,setjet/spark,SHASHANKB/spark,bdrillard/spark,patrick-nicholson/spark,nlalevee/spark,tejasapatil/spark,mike0sv/spark,sahilTakiar/spark,setjet/spark,ahnqirage/spark,shaneknapp/spark,zuotingbing/spark,hvanhovell/spark,ddna1021/spark,patrick-nicholson/spark,jrshust/spark,hvanhovell/spark,caneGuy/spark,aokolnychyi/spark,zhouyejoe/spark,saturday-shi/spark,ddna1021/spark,zzcclp/spark,apache-spark-on-k8s/spark,byakuinss/spark,aosagie/spark,adrian-ionescu/apache-spark,nilsgrabbert/spark,saltstar/spark,pgandhi999/spark,brad-kaiser/spark,debugger87/spark,sureshthalamati/spark,bravo-zhang/spark,nilsgrabbert/spark,hhbyyh/spark,stanzhai/spark,Panos-Bletsos/spark-cost-model-optimizer,techaddict/spark,dongjoon-hyun/spark,xuanyuanking/spark,chuckchen/spark,szhem/spark,kiszk/spark,goldmedal/spark,loneknightpy/spark,kimoonkim/spark,ddna1021/spark,ibm-research-ireland/sparkoscope,huang1900/spark,lvdongr/spark,icexelloss/spark,shubhamchopra/spark,cin/spark,zhouyejoe/spark,kissmetrics/spark,goldmedal/spark,MLnick/spark,kiszk/spark,rezasafi/spark,witgo/spark,mahak/spark,ConeyLiu/spark,nchammas/spark,techaddict/spark,shaneknapp/spark,dhruve/spark,zuotingbing/spark,tengpeng/spark,lxsmnv/spark,SnappyDataInc/spark,xflin/spark,nchammas/spark,tejasapatil/spark,mike0sv/spark,BryanCutler/spark,wangmiao1981/spark,lxsmnv/spark,caneGuy/spark,michalsenkyr/spark,kissmetrics/spark,xflin/spark,WeichenXu123/spark,SnappyDataInc/spark,MLnick/spark,guoxiaolongzte/spark,milliman/spark,LantaoJin/spark,someorz/spark,aokolnychyi/spark,andrewor14/spark,tejasapatil/spark,szhem/spark,BryanCutler/spark,cloud-fan/spark,rednaxelafx/apache-spark,saltstar/spark,nlalevee/spark,mzl9039/spark,kissmetrics/spark,JoshRosen/spark,skonto/spark,goldmedal/spark,nlalevee/spark,shubhamchopra/spark,huang1900/spark,joseph-torres/spark,shuangshuangwang/spark,zero323/spark,hhbyyh/spark,mahak/spark,bOOm-X/spark,darionyaphet/spark,ahnqirage/spark,sureshthalamati/spark,zuotingbing/spark,patrick-nicholson/spark,1haodian/spark,kiszk/spark,pgandhi999/spark,WeichenXu123/spark,alunarbeach/spark,vinodkc/spark,dbtsai/spark,icexelloss/spark,liutang123/spark,taroplus/spark,LantaoJin/spark,loneknightpy/spark,maropu/spark,big-pegasus/spark,adrian-ionescu/apache-spark,witgo/spark,nilsgrabbert/spark,gengliangwang/spark,LantaoJin/spark,spark-test/spark,hhbyyh/spark,markhamstra/spark,srowen/spark,mzl9039/spark,loneknightpy/spark,WindCanDie/spark,apache-spark-on-k8s/spark,skonto/spark,spark-test/spark,stanzhai/spark,ioana-delaney/spark,kiszk/spark,mzl9039/spark,srowen/spark,someorz/spark,Aegeaner/spark,facaiy/spark,nchammas/spark,stanzhai/spark,mdespriee/spark,sachintyagi22/spark,akopich/spark,WeichenXu123/spark,tejasapatil/spark,liyichao/spark,sachintyagi22/spark,BryanCutler/spark,zhouyejoe/spark,facaiy/spark,Panos-Bletsos/spark-cost-model-optimizer,sahilTakiar/spark,wangyum/spark,kiszk/spark,poffuomo/spark,yanboliang/spark,rikima/spark,kimoonkim/spark,xuanyuanking/spark,actuaryzhang/spark,icexelloss/spark,aray/spark,aosagie/spark,szhem/spark,JerryLead/spark,lxsmnv/spark,ioana-delaney/spark,ioana-delaney/spark,patrick-nicholson/spark,spark-test/spark,lvdongr/spark,metamx/spark,SHASHANKB/spark,rikima/spark,mdespriee/spark,gengliangwang/spark,rednaxelafx/apache-spark,zuotingbing/spark,apache/spark,setjet/spark,mzl9039/spark,rednaxelafx/apache-spark,poffuomo/spark,akopich/spark,techaddict/spark,nlalevee/spark,bravo-zhang/spark,witgo/spark,facaiy/spark,techaddict/spark,rezasafi/spark,alunarbeach/spark,darionyaphet/spark,HyukjinKwon/spark,someorz/spark,aokolnychyi/spark,jrshust/spark,cloud-fan/spark,cloud-fan/spark,kimoonkim/spark,jiangxb1987/spark,wzhfy/spark,shuangshuangwang/spark,andrewor14/spark,rednaxelafx/apache-spark,rekhajoshm/spark,loneknightpy/spark,taroplus/spark,vinodkc/spark,ajaysaini725/spark,UndeadBaneGitHub/spark,srowen/spark,aray/spark,brad-kaiser/spark,eyalfa/spark,SnappyDataInc/spark,bOOm-X/spark,aosagie/spark,HyukjinKwon/spark,ericvandenbergfb/spark,hhbyyh/spark,ron8hu/spark,darionyaphet/spark,ron8hu/spark,joseph-torres/spark,markhamstra/spark,jianran/spark,ajaysaini725/spark,zuotingbing/spark,apache/spark,someorz/spark,milliman/spark,nchammas/spark,ajaysaini725/spark,narahari92/spark,hvanhovell/spark,wangmiao1981/spark,ddna1021/spark,narahari92/spark,big-pegasus/spark,ddna1021/spark,adrian-ionescu/apache-spark,markhamstra/spark,bravo-zhang/spark,milliman/spark,esi-mineset/spark,nilsgrabbert/spark,UndeadBaneGitHub/spark,jkbradley/spark,byakuinss/spark,shaneknapp/spark,rezasafi/spark,poffuomo/spark,eyalfa/spark,sahilTakiar/spark,map222/spark,ConeyLiu/spark,ConeyLiu/spark,rikima/spark,dhruve/spark,JerryLead/spark,akopich/spark,alunarbeach/spark,rikima/spark,eyalfa/spark,LantaoJin/spark,WindCanDie/spark,wzhfy/spark,cloud-fan/spark,lvdongr/spark,techaddict/spark,xuanyuanking/spark,holdenk/spark,milliman/spark,ConeyLiu/spark,kiszk/spark,holdenk/spark,mike0sv/spark,WindCanDie/spark,brad-kaiser/spark,highfei2011/spark,janewangfb/spark,minixalpha/spark,wangyum/spark,ibm-research-ireland/sparkoscope,srowen/spark,byakuinss/spark,byakuinss/spark,ptkool/spark,zuotingbing/spark,publicRoman/spark,gengliangwang/spark,pgandhi999/spark,guoxiaolongzte/spark,kevinyu98/spark,1haodian/spark,janewangfb/spark,apache/spark,srowen/spark,map222/spark,jkbradley/spark,michalsenkyr/spark,srowen/spark,jkbradley/spark,JoshRosen/spark,bdrillard/spark,maropu/spark,bOOm-X/spark,LantaoJin/spark,debugger87/spark,rekhajoshm/spark,jianran/spark,minixalpha/spark,goldmedal/spark,shubhamchopra/spark,liyichao/spark,loneknightpy/spark,pgandhi999/spark,taroplus/spark,zhouyejoe/spark,ajaysaini725/spark,jiangxb1987/spark,kimoonkim/spark,poffuomo/spark,aray/spark,minixalpha/spark,highfei2011/spark,setjet/spark,ueshin/apache-spark,rikima/spark,shuangshuangwang/spark,tejasapatil/spark,HyukjinKwon/spark,alunarbeach/spark,dbtsai/spark,rezasafi/spark,actuaryzhang/spark,publicRoman/spark,narahari92/spark,ericvandenbergfb/spark,vinodkc/spark,panfengfeng/spark,shaneknapp/spark,MLnick/spark,kimoonkim/spark,aokolnychyi/spark,SnappyDataInc/spark,zhouyejoe/spark,panfengfeng/spark,dhruve/spark,actuaryzhang/spark,hvanhovell/spark,highfei2011/spark,cin/spark,Aegeaner/spark,dbtsai/spark,facaiy/spark,xuanyuanking/spark,ConeyLiu/spark,eyalfa/spark,setjet/spark,sachintyagi22/spark,kissmetrics/spark,aray/spark,dhruve/spark,michalsenkyr/spark,jkbradley/spark,spark-test/spark,aokolnychyi/spark,bOOm-X/spark,hhbyyh/spark,facaiy/spark,eyalfa/spark,sureshthalamati/spark,liutang123/spark,yanboliang/spark,kimoonkim/spark,patrick-nicholson/spark,ahnqirage/spark,lxsmnv/spark,minixalpha/spark,narahari92/spark,byakuinss/spark,ueshin/apache-spark,icexelloss/spark,bdrillard/spark,someorz/spark,patrick-nicholson/spark,markhamstra/spark,huang1900/spark,sureshthalamati/spark,huang1900/spark,big-pegasus/spark,michalsenkyr/spark,poffuomo/spark,holdenk/spark,vinodkc/spark,MLnick/spark,wangyum/spark,kiszk/spark,wangyum/spark,akopich/spark,dbtsai/spark,xflin/spark,shubhamchopra/spark,yanboliang/spark,tengpeng/spark,rikima/spark,saturday-shi/spark,wangmiao1981/spark,UndeadBaneGitHub/spark,bdrillard/spark,publicRoman/spark,darionyaphet/spark,dbtsai/spark,apache-spark-on-k8s/spark,1haodian/spark,Aegeaner/spark,ioana-delaney/spark,publicRoman/spark,wangyum/spark,wzhfy/spark,skonto/spark,andrewor14/spark,zzcclp/spark,ibm-research-ireland/sparkoscope,jrshust/spark,zero323/spark,jiangxb1987/spark