When i trying to print json in aaray format this getting me error of pymysql.err.OperationalError: (1584, "Incorrect parameters in the call to stored function 'json_arrayagg'")

test = frappe.db.sql(“”“SELECT JSON_Compose(T.customer_gstin, T.name)
FROM
(
SELECT customer_gstin as ‘ctin’, json_arrayagg(name as ‘inum’) AS ‘inv’
FROM tabSales Invoice) AS T “””, as_dict=1)