[SPARK-2494] [PySpark] make hash of None consistant cross machines
[SPARK-2494] [PySpark] make hash of None consistant cross machines

In CPython, hash of None is different cross machines, it will cause wrong result during shuffle. This PR will fix this.

Author: Davies Liu <davies.liu@gmail.com>

Closes #1371 from davies/hash_of_none and squashes the following commits:

d01745f [Davies Liu] add comments, remove outdated unit tests
5467141 [Davies Liu] disable hijack of hash, use it only for partitionBy()
b7118aa [Davies Liu] use __builtin__ instead of __builtins__
839e417 [Davies Liu] hijack hash to make hash of None consistant cross machines

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