[SPARK-10642] [PYSPARK] Fix crash when calling rdd.lookup() on tuple keys
[SPARK-10642] [PYSPARK] Fix crash when calling rdd.lookup() on tuple keys

JIRA: https://issues.apache.org/jira/browse/SPARK-10642

When calling `rdd.lookup()` on a RDD with tuple keys, `portable_hash` will return a long. That causes `DAGScheduler.submitJob` to throw `java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer`.

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

Closes #8796 from viirya/fix-pyrdd-lookup.

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