[SPARK-3891][SQL] Add array support to percentile, percentile_approx and constant inspectors support

Supported passing array to percentile and percentile_approx UDAFs
To support percentile_approx,  constant inspectors are supported for GenericUDAF
Constant folding support added to CreateArray expression
Avoided constant udf expression re-evaluation

Author: Venkata Ramana G <ramana.gollamudi@huawei.com>
I think this failure is due to the bug of nested constant Expression <-> ObjectInspector in `HiveInspectors`, and I will fix that in #3429.

@gvramana , how about revert the changes in `CreateArray` and `HiveGenericUDF`? I think we can merge the others first. And you can create a new PR for `CreateArray.foldable` which depends on #3429, since it currently doesn't break anything.