API + Transformer + SQL query

I think I got it. This appears to work, let me know if you see anything wrong with this. I'm not a programmer.

select *
From {{formatDataAsArray(query6.data) }} as property
inner join {{transformerRpCalendar.value}} as calendar on CAST(calendar.property AS int) = property.PropertyId