generated scala code of query 2 compiles