bug fix in json river build SQL