[SPARK-22811][PYSPARK][ML] Fix pyspark.ml.tests failure when Hive is not available.
[SPARK-22811][PYSPARK][ML] Fix pyspark.ml.tests failure when Hive is not available.

## What changes were proposed in this pull request?

pyspark.ml.tests is missing a py4j import. I've added the import and fixed the test that uses it. This test was only failing when testing without Hive.

## How was this patch tested?

Existing tests.

Please review http://spark.apache.org/contributing.html before opening a pull request.

Author: Bago Amirbekian <bago@databricks.com>

Closes #19997 from MrBago/fix-ImageReaderTest2.

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