[SPARK-36897][PYTHON] Use NamedTuple with variable type hints instead of namedtuple
[SPARK-36897][PYTHON] Use NamedTuple with variable type hints instead of namedtuple

### What changes were proposed in this pull request?

Use `NamedTuple` with variable type hints instead of `namedtuple`.

### Why are the changes needed?

Per discussion under https://github.com/apache/spark/pull/34133#discussion_r718833451, we wanted to replace `collections.namedtuple()` by `typing.NamedTuple`.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Existing tests.

Closes #34228 from ueshin/issues/SPARK-36897/namedtuple.

Authored-by: Takuya UESHIN <f070f8f0c50caeda5841963fc7b57e73e59dad56@databricks.com>
Signed-off-by: Hyukjin Kwon <2680965ad5aae29275c8fb10150cb10f5554e78b@apache.org>

holdenk/spark,wangyum/spark,shaneknapp/spark,gengliangwang/spark,dongjoon-hyun/spark,ueshin/apache-spark,nchammas/spark,cloud-fan/spark,wangyum/spark,HyukjinKwon/spark,zzcclp/spark,cloud-fan/spark,WeichenXu123/spark,vinodkc/spark,vinodkc/spark,zero323/spark,shaneknapp/spark,xuanyuanking/spark,gengliangwang/spark,nchammas/spark,apache/spark,srowen/spark,dongjoon-hyun/spark,nchammas/spark,zzcclp/spark,dongjoon-hyun/spark,HyukjinKwon/spark,mahak/spark,JoshRosen/spark,mahak/spark,wangyum/spark,holdenk/spark,wangyum/spark,xuanyuanking/spark,rednaxelafx/apache-spark,witgo/spark,holdenk/spark,zero323/spark,srowen/spark,hvanhovell/spark,cloud-fan/spark,srowen/spark,WeichenXu123/spark,zzcclp/spark,JoshRosen/spark,apache/spark,witgo/spark,xuanyuanking/spark,vinodkc/spark,ueshin/apache-spark,rednaxelafx/apache-spark,zero323/spark,WeichenXu123/spark,vinodkc/spark,zzcclp/spark,WeichenXu123/spark,witgo/spark,HyukjinKwon/spark,WeichenXu123/spark,rednaxelafx/apache-spark,wangyum/spark,ueshin/apache-spark,zero323/spark,vinodkc/spark,shaneknapp/spark,zzcclp/spark,HyukjinKwon/spark,ueshin/apache-spark,srowen/spark,JoshRosen/spark,JoshRosen/spark,apache/spark,hvanhovell/spark,zero323/spark,JoshRosen/spark,zero323/spark,xuanyuanking/spark,hvanhovell/spark,srowen/spark,srowen/spark,nchammas/spark,apache/spark,xuanyuanking/spark,holdenk/spark,ueshin/apache-spark,gengliangwang/spark,hvanhovell/spark,nchammas/spark,ueshin/apache-spark,WeichenXu123/spark,cloud-fan/spark,zzcclp/spark,apache/spark,wangyum/spark,apache/spark,hvanhovell/spark,JoshRosen/spark,mahak/spark,holdenk/spark,xuanyuanking/spark,cloud-fan/spark,rednaxelafx/apache-spark,shaneknapp/spark,dongjoon-hyun/spark,vinodkc/spark,witgo/spark,witgo/spark,wangyum/spark,WeichenXu123/spark,holdenk/spark,rednaxelafx/apache-spark,srowen/spark,dongjoon-hyun/spark,vinodkc/spark,cloud-fan/spark,HyukjinKwon/spark,zzcclp/spark,holdenk/spark,gengliangwang/spark,xuanyuanking/spark,HyukjinKwon/spark,hvanhovell/spark,nchammas/spark,mahak/spark,hvanhovell/spark,gengliangwang/spark,zero323/spark,JoshRosen/spark,rednaxelafx/apache-spark,HyukjinKwon/spark,mahak/spark,cloud-fan/spark,rednaxelafx/apache-spark,witgo/spark,dongjoon-hyun/spark,mahak/spark,gengliangwang/spark,apache/spark,nchammas/spark,dongjoon-hyun/spark,shaneknapp/spark,gengliangwang/spark,shaneknapp/spark,ueshin/apache-spark,witgo/spark,shaneknapp/spark,mahak/spark