Postgres Loop Through Array Php To Json Pyspark