translate casts properly to rasql