[SPARK-27016][SQL][BUILD] Treat all antlr warnings as errors while generating parser from the sql grammar file.
[SPARK-27016][SQL][BUILD] Treat all antlr warnings as errors while generating parser from the sql grammar file.

## What changes were proposed in this pull request?
Use the maven plugin option `treatWarningsAsErrors` to make sure the warnings are treated as errors while generating the parser file. In the absence of it, we may inadvertently introducing problems while making grammar changes.  Please refer to [PR-23897](https://github.com/apache/spark/pull/23897) to know more about the context.
## How was this patch tested?
We can use two ways to build Spark 1) sbt 2) Maven
This PR, we made a change to configure the maven antlr plugin to include a parameter that makes antlr4 report error on warning. However, when spark is built using sbt, we use the sbt antlr plugin which does not allow us to pass this additional compilation flag.  More info on sbt-antlr plugin can be found at [link](https://github.com/ihji/sbt-antlr4/blob/master/src/main/scala/com/simplytyped/Antlr4Plugin.scala)
In summary, this fix only applicable when we use maven to build.

Closes #23925 from dilipbiswal/antlr_fix.

Authored-by: Dilip Biswal <ee7669731148a67ed053406d4e2088f2bc2c2de0@us.ibm.com>
Signed-off-by: Sean Owen <3f9d48d7c3f24f7009479c5fa630bd1131ffc724@databricks.com>

milliman/spark,ptkool/spark,zzcclp/spark,skonto/spark,holdenk/spark,spark-test/spark,zuotingbing/spark,vinodkc/spark,wzhfy/spark,actuaryzhang/spark,HyukjinKwon/spark,skonto/spark,kevinyu98/spark,WeichenXu123/spark,shuangshuangwang/spark,kevinyu98/spark,JoshRosen/spark,mahak/spark,zero323/spark,techaddict/spark,wangyum/spark,rednaxelafx/apache-spark,zuotingbing/spark,wangmiao1981/spark,maropu/spark,pgandhi999/spark,kiszk/spark,kevinyu98/spark,mahak/spark,dbtsai/spark,cloud-fan/spark,mahak/spark,holdenk/spark,pgandhi999/spark,rezasafi/spark,rezasafi/spark,nchammas/spark,zero323/spark,aosagie/spark,zzcclp/spark,cloud-fan/spark,maropu/spark,spark-test/spark,zzcclp/spark,rezasafi/spark,rednaxelafx/apache-spark,BryanCutler/spark,ptkool/spark,BryanCutler/spark,highfei2011/spark,vinodkc/spark,pgandhi999/spark,yanboliang/spark,xuanyuanking/spark,techaddict/spark,jiangxb1987/spark,apache/spark,LantaoJin/spark,mahak/spark,icexelloss/spark,ConeyLiu/spark,mahak/spark,darionyaphet/spark,ptkool/spark,pgandhi999/spark,spark-test/spark,kiszk/spark,vinodkc/spark,chuckchen/spark,techaddict/spark,ptkool/spark,zuotingbing/spark,wangmiao1981/spark,caneGuy/spark,HyukjinKwon/spark,techaddict/spark,taroplus/spark,cloud-fan/spark,hvanhovell/spark,taroplus/spark,actuaryzhang/spark,highfei2011/spark,witgo/spark,wangmiao1981/spark,ConeyLiu/spark,mahak/spark,zzcclp/spark,jkbradley/spark,bdrillard/spark,kiszk/spark,dbtsai/spark,kiszk/spark,apache/spark,wzhfy/spark,shuangshuangwang/spark,dbtsai/spark,spark-test/spark,HyukjinKwon/spark,ConeyLiu/spark,jkbradley/spark,wzhfy/spark,rezasafi/spark,dongjoon-hyun/spark,ueshin/apache-spark,shaneknapp/spark,bdrillard/spark,actuaryzhang/spark,actuaryzhang/spark,milliman/spark,shaneknapp/spark,dbtsai/spark,bdrillard/spark,yanboliang/spark,taroplus/spark,BryanCutler/spark,witgo/spark,rednaxelafx/apache-spark,bdrillard/spark,ConeyLiu/spark,yanboliang/spark,darionyaphet/spark,zero323/spark,Aegeaner/spark,wangyum/spark,shuangshuangwang/spark,srowen/spark,gengliangwang/spark,maropu/spark,dongjoon-hyun/spark,actuaryzhang/spark,JoshRosen/spark,srowen/spark,wangyum/spark,jiangxb1987/spark,maropu/spark,xuanyuanking/spark,icexelloss/spark,skonto/spark,HyukjinKwon/spark,vinodkc/spark,highfei2011/spark,zzcclp/spark,Aegeaner/spark,wzhfy/spark,LantaoJin/spark,ueshin/apache-spark,srowen/spark,BryanCutler/spark,kevinyu98/spark,ptkool/spark,icexelloss/spark,ConeyLiu/spark,rednaxelafx/apache-spark,wangyum/spark,BryanCutler/spark,wangyum/spark,jiangxb1987/spark,witgo/spark,darionyaphet/spark,kevinyu98/spark,holdenk/spark,rednaxelafx/apache-spark,kiszk/spark,hvanhovell/spark,JoshRosen/spark,icexelloss/spark,darionyaphet/spark,ptkool/spark,zzcclp/spark,zuotingbing/spark,zero323/spark,milliman/spark,wangyum/spark,shaneknapp/spark,holdenk/spark,taroplus/spark,nchammas/spark,caneGuy/spark,JoshRosen/spark,ueshin/apache-spark,kiszk/spark,mahak/spark,zuotingbing/spark,dbtsai/spark,cloud-fan/spark,highfei2011/spark,pgandhi999/spark,highfei2011/spark,shaneknapp/spark,jiangxb1987/spark,gengliangwang/spark,cloud-fan/spark,rednaxelafx/apache-spark,goldmedal/spark,chuckchen/spark,Aegeaner/spark,JoshRosen/spark,dbtsai/spark,gengliangwang/spark,highfei2011/spark,dbtsai/spark,goldmedal/spark,dongjoon-hyun/spark,icexelloss/spark,wzhfy/spark,darionyaphet/spark,witgo/spark,maropu/spark,xuanyuanking/spark,hvanhovell/spark,hvanhovell/spark,HyukjinKwon/spark,goldmedal/spark,ueshin/apache-spark,skonto/spark,chuckchen/spark,shuangshuangwang/spark,spark-test/spark,goldmedal/spark,holdenk/spark,caneGuy/spark,srowen/spark,highfei2011/spark,chuckchen/spark,actuaryzhang/spark,jkbradley/spark,WeichenXu123/spark,holdenk/spark,kevinyu98/spark,zuotingbing/spark,HyukjinKwon/spark,darionyaphet/spark,shaneknapp/spark,skonto/spark,ptkool/spark,aosagie/spark,shuangshuangwang/spark,caneGuy/spark,maropu/spark,nchammas/spark,caneGuy/spark,pgandhi999/spark,cloud-fan/spark,milliman/spark,hvanhovell/spark,dongjoon-hyun/spark,LantaoJin/spark,taroplus/spark,jkbradley/spark,wangyum/spark,xuanyuanking/spark,rezasafi/spark,holdenk/spark,bdrillard/spark,dongjoon-hyun/spark,chuckchen/spark,nchammas/spark,rezasafi/spark,goldmedal/spark,skonto/spark,wangmiao1981/spark,aosagie/spark,wangmiao1981/spark,xuanyuanking/spark,icexelloss/spark,vinodkc/spark,WeichenXu123/spark,spark-test/spark,bdrillard/spark,WeichenXu123/spark,xuanyuanking/spark,chuckchen/spark,jkbradley/spark,milliman/spark,ueshin/apache-spark,techaddict/spark,rednaxelafx/apache-spark,Aegeaner/spark,zero323/spark,vinodkc/spark,zzcclp/spark,caneGuy/spark,JoshRosen/spark,yanboliang/spark,kevinyu98/spark,yanboliang/spark,maropu/spark,techaddict/spark,ConeyLiu/spark,LantaoJin/spark,matthewfranglen/spark,jkbradley/spark,aosagie/spark,aosagie/spark,jkbradley/spark,yanboliang/spark,witgo/spark,zero323/spark,shuangshuangwang/spark,Aegeaner/spark,wzhfy/spark,witgo/spark,xuanyuanking/spark,rezasafi/spark,gengliangwang/spark,ConeyLiu/spark,icexelloss/spark,nchammas/spark,darionyaphet/spark,WeichenXu123/spark,gengliangwang/spark,srowen/spark,cloud-fan/spark,yanboliang/spark,shaneknapp/spark,jiangxb1987/spark,shuangshuangwang/spark,jiangxb1987/spark,witgo/spark,milliman/spark,hvanhovell/spark,actuaryzhang/spark,LantaoJin/spark,nchammas/spark,WeichenXu123/spark,taroplus/spark,gengliangwang/spark,skonto/spark,apache/spark,ueshin/apache-spark,srowen/spark,dongjoon-hyun/spark,gengliangwang/spark,nchammas/spark,aosagie/spark,LantaoJin/spark,apache/spark,techaddict/spark,chuckchen/spark,zuotingbing/spark,hvanhovell/spark,caneGuy/spark,taroplus/spark,apache/spark,WeichenXu123/spark,aosagie/spark,BryanCutler/spark,Aegeaner/spark,wzhfy/spark,spark-test/spark,bdrillard/spark,zero323/spark,HyukjinKwon/spark,goldmedal/spark,wangmiao1981/spark,vinodkc/spark,srowen/spark,dongjoon-hyun/spark,jiangxb1987/spark,JoshRosen/spark,pgandhi999/spark,apache/spark,milliman/spark,LantaoJin/spark,ueshin/apache-spark,goldmedal/spark,wangmiao1981/spark,shaneknapp/spark,BryanCutler/spark,apache/spark,Aegeaner/spark,kiszk/spark